Hi Ted, A few observations about your original message:
The curl command you provided looks correct, however, there are new line characters after each header (Content-Type, Riak-X-Vclock). I am not sure whether or not those were added by the email client. The presence of new line characters in the headers would cause the request to fail. The request should work without the new line characters: curl -v -X PUT -d '{"bar":"baz"}' -H "Content-Type: application/json" -H "X-Riak-Vclock:a85hYGBgzGDKBVIszMk55zKYEhnzWBlKIniO8mUBAA==" http://127.0.0.1:8091/riak/test/doc?returnbody=true I am not sure what you mean by converting the command to HTTP headers. The raw request looks as follows: PUT /riak/test/doc?returnbody=true HTTP/1.1 Content-Type: application/json X-Riak-Vclock: a85hYGBgzGDKBVIszMk55zKYEhnzWBlKIniO8mUBAA== {"bar":"baz"} Regarding your last attempt, option "c", it's important to note that URL parameters are not included in the body of the request when processed by Riak. Riak will store the data included in the body of the request and ignore unrecognized URL parameters. Thanks, Dan Daniel Reverri Developer Advocate Basho Technologies, Inc. d...@basho.com On Tue, Jun 22, 2010 at 2:27 PM, Dan Reverri <d...@basho.com> wrote: > Hi Ted, > > Documentation for the REST API can be found here: > https://wiki.basho.com/display/RIAK/REST+API > > > Regarding the failed requests, can you show us the various requests you are > making via curl along with the responses? > > Thanks, > Dan > > Daniel Reverri > Developer Advocate > Basho Technologies, Inc. > d...@basho.com > > > On Tue, Jun 22, 2010 at 1:24 PM, Ted Karmel <ted.kar...@gmail.com> wrote: > >> Does Riak have an HTTP API doc ( similar to the CouchDB one found >> here: http://wiki.apache.org/couchdb/HTTP_Document_API )? >> >> The closest thing I can find is the Riak Fast Track ( >> https://wiki.basho.com/display/RIAK/The+Riak+Fast+Track ). But that >> is in curl only rather than explicit HTTP headers. >> >> In particular, I have a problem with the PUT request in the following >> curl command >> >> $ curl -v -X PUT -d '{"bar":"baz"}' -H "Content-Type: >> application/json" -H "X-Riak-Vclock: >> a85hYGBgzGDKBVIszMk55zKYEhnzWBlKIniO8mUBAA==" >> http://127.0.0.1:8091/riak/test/doc?returnbody=true >> >> I try to convert the command into HTTP headers but the request fails >> when the followin is attempted : >> >> a) include {"bar":"baz"} in the body and set the Content-Type header >> to application/json >> b) same as a) but add another Content-Type header value - this time >> of application/x-www-form-urlencoded ( inspired by the info on the >> -d command found in the following curl manual >> http://curl.haxx.se/docs/manpage.html ) >> c) same as b) but instead of placing {"bar":"baz"} in the body, add >> ampersand in the url and bar=baz >> http://127.0.0.1:8091/riak/test/doc?returnbody=true&bar=baz >> >> I tried looking for an equivalent to the Live HTTP Headers extension >> on Firefox but which would capture activity from curl commands. Then, >> I could get a better idea of how to formulate the HTTP headers. >> >> Please Help... >> >> if there is an HTTP API doc with explicity header request info >> >> how to formulate this particular PUT request with the HTTP headers >> >> good ubuntu linux utility for capturing http activity even if not from >> browser application >> >> _______________________________________________ >> riak-users mailing list >> riak-users@lists.basho.com >> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com >> > >
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com