flat assembler
Message board for the users of flat assembler.
Index
> Windows > windows HTTP strange problem |
Author |
|
caoyunbin001 17 Feb 2012, 14:30
First of all, apologize in advance for my poor English, I'm a Chinese.
I'm testing an HTTP program, which will simply send some data to the server and get a respond. see attachment for the program. see this link for testing: http://www.easy-creator.net/test2/test.asp this program always fail, or just in my computer? I'm running win7-64bit, I've pre-set a debug break on where the error will occur and put a comment there and it wont get correct result, when WinHTTPAddRequestHeader was removed, this program will run, but wont get a correct result, when the web page is opened, it shows nothing, no posted data
|
|||||||||||||||||||||||||||||
17 Feb 2012, 14:30 |
|
caoyunbin001 18 Feb 2012, 08:45
LocoDelAssembly wrote: The problem is that you are passing the wrong length, it should be sizeof.wcHeader/2 (i.e. the number of chars, not bytes). Since your string is zero-terminated, you could just pass -1 and forget about dealing with lengths. oops, I just forgot the unicode/ascii problems... msdn told me that, just missed it .... but why my program can't post data to the server? first of all, I used ascii: "test=1111232...", and when I interrupted the send package, I did see that it was send to the server, why I can't see a result? |
|||
18 Feb 2012, 08:45 |
|
caoyunbin001 18 Feb 2012, 08:47
caoyunbin001 wrote:
nothin~ nothin~ forget about it .... it works , just need that header so it can work... but why? why that header is necessary? who can tell me ? thanks in advance... |
|||
18 Feb 2012, 08:47 |
|
LocoDelAssembly 18 Feb 2012, 17:55
I believe you mean the Content-Type header? The web server needs it to know what are you sending to it (remember that POST is also used to send files for instance). When you use "application/x-www-form-urlencoded" the ASP engine knows that it must set up the Request.Form array with the data you supplied (or whatever means ASP provides to read form data, I don't know ASP much)
|
|||
18 Feb 2012, 17:55 |
|
caoyunbin001 21 Feb 2012, 12:04
LocoDelAssembly wrote: I believe you mean the Content-Type header? The web server needs it to know what are you sending to it (remember that POST is also used to send files for instance). When you use "application/x-www-form-urlencoded" the ASP engine knows that it must set up the Request.Form array with the data you supplied (or whatever means ASP provides to read form data, I don't know ASP much) Thanks, Helped a lot. |
|||
21 Feb 2012, 12:04 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.