Solved

CHTTPConnection and POST method

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

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: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

734 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