Archived Forum Post

Index of archived forum posts

Question:

HTTP POST param issue

May 04 '14 at 22:45

Hi Chilkat Support,

Correct POST captured using Fiddler


POST http://bbs.xxxxg.com/forum.php?mod=post&action=reply&fid=133&tid=55556&
extra=page%3D1&replysubmit=yes&infloat=yes&handlekey=fastpost&inajax=1 HTTP/1.1
Accept: text/html, application/.......
.....
.....
Cookie: xxxxxxxxx
message=%B6%A5%C9%CF%7E%7E%7E%7E%7E&posttime=1398600510&formhash=77e8f013&
usesig=1&subject=++


The problem is the param "subject" value, I am getting %2B%2B instead of ++:


message=%B6%A5%C9%CF%7E%7E%7E%7E%7E&posttime=1398915054&formhash=f227f7b&
usesig=1&subject=%2B%2B


my code is

Request.AddParam("subject","++");

I also tried " " (spacespace) as it is encoded as ++ in URL encoding/decoding.
But I got %20%20.

The response I get is invalid symbol found.

Please advise what can be done to get :
subject=++.

Thanks in advance.

(I am using the 9.5.0.36 VC++ 9 win32)

Best regards
Dragon


Answer

If the Content-Type of the POST is application/x-www-form-urlencoded, then it is correct to URL encoded the params in the body as Chilkat has done. The exact URL encoding used by Chilkat is according to RFC 3986.

If you don't want this format, another option is to set the HttpRequest object's ContentType property equal to "text/namevalue". This will cause the params to be sent in "NVP" format.


Answer

Oh, great ! Thanks.