couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Weber <>
Subject API to Update httpd_db_handlers in Config
Date Fri, 31 Jan 2014 18:30:37 GMT
How does one perform am API based update to the "httpd_db_handlers" section of the config.

Given something like this:

_my_function = {couch_httpd_external, handle_external_req, <<"my_function">>}

I try to update it with:

  couchSend( "PUT /_config/httpd_db_handlers/_my_function", 

     "{couch_httpd_external, handle_external_req, <<\"my_functioni\"\>>}"

If failing with a "invalid JSON"...  Which I can see that it is.
It logs  "lexical error: invalid char in json text.\n"}},  But doesn't tell me which character
it doesn't like.

However, I was able to update something else like this:

     couchSend( "PUT /_config/log/include_sasl", 

      "\"false\"" );

And it works fine.

Without wasting a bunch of bandwidth telling ALL the different ways I have tried to escape
the quotes, added extra quotes, encoded angle brackets, braces, tried using text/plain, text/html,
etc... (or tell my boss how much it cost him while I am trying all different these ways, and
doing web searches)  I figure I'll just give up and ask.  :-)

How does one encode the following string for an API based config update?

    {couch_httpd_external, handle_external_req, <<"my_function">>}


View raw message