Discussion:
How to do "POST" and retrieve multipart file?
(too old to reply)
sterrie
2005-06-15 11:59:02 UTC
Permalink
Hi,

I have to contact a server, send him a XML-file and get back a
multi-part file containing XML + binary data.

In the MSDN I found the documentation about WinInet but I do not
understand everything.

1. I have the URL but where do I have to put it in the method
HttpOpenRequest?


2. What's the difference between lpszObjectName and lpszReferrer in
HttpOpenRequest?


3. Which type I have to use for the lplpszAcceptTypes parameter because
"text/*" is not enough (for multi-part messages)?


Thx,


terrie
Reymarx Gereda
2005-06-18 18:32:37 UTC
Permalink
Hi Terrie,

If you want to send an http request to the server using a POST verb you can
use InternetConenct with the name of the server you want to connec to and
then use the returned connection handle with HttpOpenRequest specifying
"POST" in the lpszVerb parameter, the resource name (withouth http:// and
the server name) in the lpszObjectName parameter and and array of all the
accept types in the lpszAcceptTypes parameter containing "text/*"
"multipart/mixed" or any other accept type your application handles.

the ObjectName parameter is the path to the resource you want to access in
the server you're connecting to. The referer parameter can be used to
specify the resource (html page for example) that contains the link to the
resource you're accessing now. it's commonly passed as null for
applications.

You can find more information in:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/httpopenrequest.asp
http://www.mindcracker.com/mindcracker/c_cafe/wininet/wit2.asp

Hope this can helps you.
--
Reymarx [MSFT]
Windows- Networking
This posting is provided "AS IS" with no warranties, and confers no rights
Post by sterrie
Hi,
I have to contact a server, send him a XML-file and get back a
multi-part file containing XML + binary data.
In the MSDN I found the documentation about WinInet but I do not
understand everything.
1. I have the URL but where do I have to put it in the method
HttpOpenRequest?
2. What's the difference between lpszObjectName and lpszReferrer in
HttpOpenRequest?
3. Which type I have to use for the lplpszAcceptTypes parameter because
"text/*" is not enough (for multi-part messages)?
Thx,
terrie
Loading...