cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem Related to Post Method 401 unautherized

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 23 Jul 2008 19:00:31 +0200 (CEST)

On Wed, 23 Jul 2008, Ajeet kumar.S wrote:

> curl_easy_setopt(curl, CURLOPT_POSTFIELDS,
> "username=string&password=string");
>
> curl_easy_setopt(curl, CURLOPT_USERPWD, MAC ID: Password);

This line is of course invalid C.

> for login and device authentication. But it is not giving correct response.
> Can you explain briefly about how we can use post method instead of GET
> method?

You can't just pick either method by your own choice but it depends on what
the server wants. I suggest you go read up on this subject:

         http://curl.haxx.se/docs/httpscripting.html

-- 
  / daniel.haxx.se
Received on 2008-07-23