Discussion:
sending binary data on http
(too old to reply)
Abubakar
2006-10-27 12:56:56 UTC
Permalink
Hi,

i'm using wininet apis from c++ code and accessing my http web server.
Uptill now when ever I want to send something (some information) to the
server I use the url to add that information. Like say i wanna get item # 3,
I would add "&item=3" to the url and pass it to HttpOpenRequestA. Now the
problem is that I want to send some binary data to the webserver, say I have
a series of binary data in a char* and now I want to send it to the server.
I have no idea how do I do that. Naturally i cant use a normal url since its
a text thing (thats what i think). Can HttpAddRequestHeadersA help maybe?

Regards,

-ab.
Vladimir Scherbina
2006-10-27 07:13:03 UTC
Permalink
Abubakar,

The first mentioned by you method refers to using 'GET' request. Which makes
impossible to send binary data + the length of the URL is limited for
browsers. Using 'POST' request allows you to add binary data to your
request.

Yes, you can do that using HttpAddRequestHeaders.
--
Vladimir
Post by Abubakar
Hi,
i'm using wininet apis from c++ code and accessing my http web server.
Uptill now when ever I want to send something (some information) to the
server I use the url to add that information. Like say i wanna get item #
3, I would add "&item=3" to the url and pass it to HttpOpenRequestA. Now
the problem is that I want to send some binary data to the webserver, say
I have a series of binary data in a char* and now I want to send it to the
server. I have no idea how do I do that. Naturally i cant use a normal url
since its a text thing (thats what i think). Can HttpAddRequestHeadersA
help maybe?
Regards,
-ab.
Abubakar
2006-10-31 15:15:52 UTC
Permalink
Hey thanks, I tried and its working.

-ab.
Post by Vladimir Scherbina
Abubakar,
The first mentioned by you method refers to using 'GET' request. Which
makes impossible to send binary data + the length of the URL is limited
for browsers. Using 'POST' request allows you to add binary data to your
request.
Yes, you can do that using HttpAddRequestHeaders.
--
Vladimir
Post by Abubakar
Hi,
i'm using wininet apis from c++ code and accessing my http web server.
Uptill now when ever I want to send something (some information) to the
server I use the url to add that information. Like say i wanna get item #
3, I would add "&item=3" to the url and pass it to HttpOpenRequestA. Now
the problem is that I want to send some binary data to the webserver, say
I have a series of binary data in a char* and now I want to send it to
the server. I have no idea how do I do that. Naturally i cant use a
normal url since its a text thing (thats what i think). Can
HttpAddRequestHeadersA help maybe?
Regards,
-ab.
Continue reading on narkive:
Loading...