Banging head against wall with erlang pb client

Jon Brisbin jon at jbrisbin.com
Fri Apr 1 09:24:24 EDT 2011


I knew it was something simple and that I was trying to barrel through it too quickly. I think I've even asked this before and couldn't figure out why what I was doing wasn't working.

I had to go through the list of custom properties with keys like ("test") and turn them into keys like "X-Riak-Meta-test" and stick those in a proplist hanging off the "X-Riak-Meta" key.

Thanks for setting me straight. ;)

jb


On Mar 31, 2011, at 6:18 PM, Dan Reverri wrote:

> Hi Jon,
> 
> The value for content-type should be a string.
> 
> For custom meta data the client expects a proplist of custom headers under the <<"X-Riak-Meta">> key. Check out the following test to get an idea of what the metadata would look like:
> https://github.com/basho/riak-erlang-client/blob/master/src/riakc_pb.erl#L311
> 
> Thanks,
> Dan
> 
> Daniel Reverri
> Developer Advocate
> Basho Technologies, Inc.
> dan at basho.com
> 
> 
> On Thu, Mar 31, 2011 at 3:58 PM, Jon Brisbin <jon at jbrisbin.com> wrote:
> I know I'm doing something obvious wrong, but I can't seem to make this:
> 
> {riakc_obj,<<"riak">>,<<"test">>,undefined,[],
>                    {dict,2,16,16,8,80,48,
>                          {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
>                          {{[],[],
>                            [[<<"test">>|<<"header">>]],
>                            [],[],[],[],[],[],[],
>                            [[<<"content-type">>|<<"text/plain">>]],
>                            [],[],[],[],[]}}},
>                    <<"Hello World!">>}
> 
> appear correctly in the database. It has the wrong content-type:
> 
> HTTP/1.1 200 OK
> X-Riak-Vclock: a85hYGBgzGDKBVIsDJYbJTOYEhnzWBkymjiP82UBAA==
> Vary: Accept-Encoding
> Server: MochiWeb/1.1 WebMachine/1.7.3 (participate in the frantic)
> Link: </riak/riak>; rel="up"
> Last-Modified: Thu, 31 Mar 2011 22:55:36 GMT
> Etag: "5Pkvq3UKB5dl5ltv1YtcdD"
> Date: Thu, 31 Mar 2011 22:55:43 GMT
> Content-Type: application/octet-stream
> Content-Length: 12
> 
> Hello World!
> 
> The custom headers are also not showing up.
> 
> What am I not doing here?
> 
> Thanks!
> 
> Jon Brisbin
> 
> http://jbrisbin.com
> Twitter: @j_brisbin
> 
> 
> 
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> 


Thanks!

Jon Brisbin

http://jbrisbin.com
Twitter: @j_brisbin


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110401/59d63f79/attachment.html>


More information about the riak-users mailing list