curl-library
Re: CURL custom POST commands
Date: Tue, 14 Jul 2015 15:23:09 -0600
> On Jul 14, 2015, at 12:10 PM, Fitzgerald, Kevin <kevin.fitzgerald_at_hp.com> wrote:
>
> I have to connect to a web service that requires a username and password and as a result I cannot use the basic CURL POST logic. Does anyone have a program or example of how to use CURL to set up a custom POST? I need to send a request and then receive a response from the web service.
>
The anyauthput.c example shows how to use HTTP auth with a PUT request, but it also includes some extra stuff (ioctl callback) needed to support the "any" auth type.
http://curl.haxx.se/libcurl/c/anyauthput.html <http://curl.haxx.se/libcurl/c/anyauthput.html>
For just HTTP Basic auth, here is a working example:
https://gist.github.com/p120ph37/71fb340f7a0d38fa5443 <https://gist.github.com/p120ph37/71fb340f7a0d38fa5443>
-Aaron
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-07-14