Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to POST form data using wininet.dll

304 views
Skip to first unread message

pete...@my-deja.com

unread,
Jan 18, 2001, 11:13:40 AM1/18/01
to
Hi Everyone,

Deos anyone know how to use POST method to submit a string to web
server.

I am tring to use wininet.dll write a string upload application. I
use "HttpOpenRequest" and "HttpSendRequest" method to send string.

But it does not work!!! Does anyone did this before?

You help is very important to me. Thank you very much.

Peter Zheng


Sent via Deja.com
http://www.deja.com/

pete...@my-deja.com

unread,
Jan 18, 2001, 11:12:43 AM1/18/01
to

Michael Shutt

unread,
Jan 18, 2001, 1:33:22 PM1/18/01
to
I will assume that you are already passing the properly formatted post data
in the call to HttpSendRequest using the lpOptional and dwOptionalLength
parameters. The other thing you'l have to do in order for IIS to recognize
the data is to include a header of "Content-type:
application/x-www-form-urlencoded" using the lpszHeaders and dwHeadersLength
parameters.

You probably want to look at KB articel Q175474.


<pete...@my-deja.com> wrote in message news:9474nb$bah$1...@nnrp1.deja.com...

pete...@my-deja.com

unread,
Jan 18, 2001, 6:44:32 PM1/18/01
to
Micheal,

Thank you very much. Campare the sample code, I found I make a mistake
when I append "cookie" and "Content-type" into request header.

I get it works.

Thank you for your help.

By the way, when you send request, all windows belong to that
application are no responding. Can I avoid of that by using MSINET.OCX?
(Because ActiveX Control is not on processing.)

Thanks Again

Peter Zheng

In article <O6KpN1XgAHA.1280@tkmsftngp04>,

Michael Shutt

unread,
Jan 19, 2001, 7:29:31 AM1/19/01
to
Yes. I have used that control quite a bit. It is great for simple
transfers. It must launch a worker to handle the requests because the call
and response is asynchronous, which means your application is not blocked.

<pete...@my-deja.com> wrote in message news:947v4u$55t$1...@nnrp1.deja.com...

pete...@my-deja.com

unread,
Jan 22, 2001, 8:21:50 AM1/22/01
to
Michael,

Thank for you reply. Actually, My program can post data to server now.
But now my problem is following.

In the form tag, there is a name attribute, which value is form1. I do
not know how to submit this parameter. Is it also in request header or
in message body?

thank you

Peter Zheng
In article <uYIv3NhgAHA.464@tkmsftngp04>,

Michael Shutt

unread,
Jan 22, 2001, 6:28:53 PM1/22/01
to
I'm not sure I understand. You don't have to post the name of form with the
data. As far as I know, the name of the form does not get sent to the
server in standard application/x-www-form-urlencoded or mime encoded
posts.

<pete...@my-deja.com> wrote in message news:94hc59$ef4$1...@nnrp1.deja.com...

0 new messages