Discussion:
submitting \n in the querystring parameters
(too old to reply)
Abubakar
2007-05-03 15:30:36 UTC
Permalink
Hi,
I've written some code using wininet functions (HttpOpenRequest etc). I'm
calling a url through my code passing it parameters in the format :
http://someip.com?id=3&messagebody=hello world
something like above. Now the above parameter *messagebody* is composed of
some text sentences which also have the ascii characters 13 and 10 as part
of it (cuz it was taken from a textbox). The problem is that when this text
goes to the server through this url's messagebody param, the 13 and 10 ascii
codes disappear. What can I do so that the 13 and 10 ascii codes are
preserved? The text that I'm sending has a to be stored in a data base and
later on retrieved.

Regards,

..ab
Scherbina Vladimir
2007-05-03 22:41:51 UTC
Permalink
Do not pass data in get request, instead pass it in post.
--
--Vladimir, Windows SDK MVP
Post by Abubakar
Hi,
I've written some code using wininet functions (HttpOpenRequest etc). I'm
http://someip.com?id=3&messagebody=hello world
something like above. Now the above parameter *messagebody* is composed of
some text sentences which also have the ascii characters 13 and 10 as part
of it (cuz it was taken from a textbox). The problem is that when this
text goes to the server through this url's messagebody param, the 13 and
10 ascii codes disappear. What can I do so that the 13 and 10 ascii codes
are preserved? The text that I'm sending has a to be stored in a data base
and later on retrieved.
Regards,
..ab
Abubakar
2007-05-04 06:01:58 UTC
Permalink
Hi,
I thought I'm using post cuz I'm using the following code:
HINTERNET openhnet = ::HttpOpenRequestA (
hconnect,
"POST",
m_rest_of_url_text,
"HTTP/1.1",
NULL,
types,
INTERNET_FLAG_NO_CACHE_WRITE | ( isHttps () ? getHttpsFlags(): 0 ),
0 ) ;
If its not the way plz tell how do I make it a post request.

Regards,

..ab
Post by Scherbina Vladimir
Do not pass data in get request, instead pass it in post.
--
--Vladimir, Windows SDK MVP
Post by Abubakar
Hi,
I've written some code using wininet functions (HttpOpenRequest etc). I'm
http://someip.com?id=3&messagebody=hello world
something like above. Now the above parameter *messagebody* is composed
of some text sentences which also have the ascii characters 13 and 10 as
part of it (cuz it was taken from a textbox). The problem is that when
this text goes to the server through this url's messagebody param, the 13
and 10 ascii codes disappear. What can I do so that the 13 and 10 ascii
codes are preserved? The text that I'm sending has a to be stored in a
data base and later on retrieved.
Regards,
..ab
Abubakar
2007-05-04 17:43:55 UTC
Permalink
Hey I have done it. The msdn page titled: "HTTP Sessions" was really
helpful. And some code that I borrowed a single line from codeguru titled:
"Generic HTTP Client" by Heo Yongsun.

Thanks all.
Post by Abubakar
Hi,
HINTERNET openhnet = ::HttpOpenRequestA (
hconnect,
"POST",
m_rest_of_url_text,
"HTTP/1.1",
NULL,
types,
INTERNET_FLAG_NO_CACHE_WRITE | ( isHttps () ? getHttpsFlags(): 0 ),
0 ) ;
If its not the way plz tell how do I make it a post request.
Regards,
..ab
Post by Scherbina Vladimir
Do not pass data in get request, instead pass it in post.
--
--Vladimir, Windows SDK MVP
Post by Abubakar
Hi,
I've written some code using wininet functions (HttpOpenRequest etc).
http://someip.com?id=3&messagebody=hello world
something like above. Now the above parameter *messagebody* is composed
of some text sentences which also have the ascii characters 13 and 10 as
part of it (cuz it was taken from a textbox). The problem is that when
this text goes to the server through this url's messagebody param, the
13 and 10 ascii codes disappear. What can I do so that the 13 and 10
ascii codes are preserved? The text that I'm sending has a to be stored
in a data base and later on retrieved.
Regards,
..ab
Loading...