Solved

CHTTPConnection and POST method

Posted on 1997-04-22
2
609 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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 gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now