Solved

CHTTPConnection and POST method

Posted on 1997-04-22
2
613 Views
Last Modified: 2013-11-20
I just don't see how CHTTPConnection::OpenRequest()  works with HTTP_VERB_POST  :

How do I send parameters to the server ?
How do I retreive the result ?

Thanks for your help.
0
Comment
Question by:sbahuaud
2 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 75 total points
ID: 1301142
Call OpenRequest() to open a request.  This gets you a pointer to a CHttpFile object, which you'll need to Close() and then delete when you're done.

On that CHttpFile object, call AddHeaders() if you want to send some HTTP headers.

Call SendRequest() on the CHttpFile object to actually send it off to the server.  You should supply your POST data to SendRequest() using the lpOptional and dwOptionalLen parameters.  If you want, you can use the pstrHeaders and dwHeadersLen parameters to supply your headers instead of calling AddHeaders().

Now that SendRequest() has returned, you're ready to start reading the response to your request.  Call QueryInfoStatusCode() on your CHttpFile to see what status code the server returned.  Call ReadString() on your CHttpFile to get string data, or call Read() to get binary data.

.B ekiM

0
 

Author Comment

by:sbahuaud
ID: 1301143
Thks !
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need to retreive data from .TFS file exported by DVR 8 200
Strange date stored 22 123
Folder Comparison 12 54
Window placement 17 83
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question