On Mon, 19 Jul 2021, Venkat Maddisetti via curl-library wrote:

Before coming here I realized curl_easy_setopt has no effect setting username and password

CURLOPT_USERPWD, CURLOPT_USERNAME and CURLOPT_PASSWORD included ?

"POST /emp/ HTTP/1.1

If you want HTTP, then using CONNECT_ONLY + send/recv is *extremely* rarely the right answer.

You seem to want a plain POST with Basic auth and libcurl does that pretty well and simply with the regular easy API.

First, get the http-post.c example
Then set CURLOPT_USERNAME and CURLOPT_PASSWORD
Then set the right Content-type and make sure the right request body is sent.

Doesn't that cover it?

--

 / daniel.haxx.se
 | Commercial curl support up to 24x7 is available!
 | Private help, bug fixes, support, ports, new features
 | https://www.wolfssl.com/contact/
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to