[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

CHTTPConnection and POST method

Posted on 1997-04-22
2
Medium Priority
?
665 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 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month18 days, 19 hours left to enroll

834 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