cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: passing_string_in_header

From: Ray Satiro via curl-library <curl-library_at_cool.haxx.se>
Date: Wed, 2 Mar 2016 14:46:34 -0500

On 3/2/2016 1:04 PM, ravi kumar via curl-library wrote:
> Hello,
> I am encoding base64 of xml in string data.Now i have to pass data in
> header parameter.
> I am able to pass json or xml format in header.
> header_list = curl_slist_append(header_list, "json or xml format");
>
> Now, i have to pass string in header like
> char *buff="ABCD...MN";
> I am using
> header_list = curl_slist_append(header_list, buff);
>
> how will send string in header(not xml or json)
>

Please stop starting new topics for the same thing and also top posting
[1] in replies, both make the conversation harder to follow.

When you send data in a header field it should be in the 'name: value'
format. Based on your screenshot of the manual they want the value for
feed to be base64 encoded. One interesting thing here is whether the
header can be continued over multiple lines (I'm not sure about that
myself) but I would not do that and check to make sure your base64
encoder is not doing that.

header_list = curl_slist_append(header_list, "feed: <base64data>");

[1]: https://curl.haxx.se/mail/etiquette.html#Do_Not_Top_Post

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-03-02