?
Solved

CHTTPConnection and POST method

Posted on 1997-04-22
2
Medium Priority
?
633 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 150 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

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

752 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