hRequest = WinHttpOpenRequest( hConnect,
L"POST",
L"/secure/echo.asp",
NULL,
WINHTTP_NO_REFERER,
WINHTTP_DEFAULT_ACCEPT_TYPES,
WINHTTP_FLAG_SECURE );
if ( hRequest )
{
bResults = WinHttpSendRequest( hRequest,
WINHTTP_NO_ADDITIONAL_HEADERS,
0,
WINHTTP_NO_REQUEST_DATA,
0,
strlen( szCCData ),
0 );
if ( bResults )
{
bResults = WinHttpWriteData( hRequest,
szCCData,
strlen( szCCData ),
&dwBytesWritten );
I want to send the contents of szCCdata with the POST request. My understanding is that the contents of szCCData will be sent with WinHttpWriteData and not with the WinHttpSendRequest since I made the length of the optional data (dwOptionalData in API prototype) zero and the length of the data to be sent is greater than zero. I also tried changing the length of the optional data from 0 to strlen(szCCData) in the WinHttpSendRequest and commented out the WinHttpWriteData to see if the data would be sent just using the WinHttpSendRequest call (I don't know if that is correct) and I got the same result.
I have checked the data (szCCData) in memory before the calling the API's and the data is fine. I know I am connecting with the server because it is responding to my request but it indicates it received no data in the POST operation.
If you are going to POST form data you SHOULD explicitly specify content
type header.
With best regards,
Alex Ostapenko,
Helicon Tech.
SAMPLE:
name="sjname" value="Jimmy SkipJack Test"
name="email" value="te...@skipjack.com"
name="Streetaddress" value="10549 Reading Rd" name="state" value="OH" name="city" value="Cincinnati"
name="zipcode" value="45241"
name="ordernumber" value="1"
name="accountnumber" value="4445999922225"
name="month" value="12"
name="year" value="04"
name="serialnumber" value="000594108441"
name="Transactionamount" value="1.00"
name="Orderstring" value="1~1~0.00~1~N~||"
name="shiptophone" value="8883688507"
Can you do the request with IE and WinHttp without using SSL? If so, you
can use a network sniffer to see the difference between what IE is doing and
what your application is doing with WinHttp. I have a thread at
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&c2coff=1&selm=OXPJMjAaDHA.1004%40TK2MSFTNGP12.phx.gbl
(thread title: Re: How to "see" a POST from IE
) which discusses some network sniffers available. Netmon is what I prefer
but its not always available.
The data you have is similar to but not the same as what form data formats
I've seen in the past, so I don't have a recommendation for what
content-type to use. That may or may not be the issue, hopefully you can
get a network sniff going.
"BWHUGHE" <BWH...@discussions.microsoft.com> wrote in message
news:14114864-102B-40D0...@microsoft.com...
Brian