curl-library
How to resend request when authentication
Date: Thu, 26 Dec 2013 17:49:50 +0800
Hi
I'm working for basic authentication by curl.
I set header callback as follow.
curl_easy_setopt(d->m_handle, CURLOPT_HEADERFUNCTION, headerCallback);
In headerCallback(),I set authentication message when catch 401 httpcode.
String userpass = credential.user() + ":" + credential.password();
curl_easy_setopt(d->m_handle, CURLOPT_USERPWD, userpass.utf8().data());
In the run , I set wrong user and password for request.
In expect headerCallback() will be called until I set right message .
but actually ,It just call two times,then give me a wrong page.
Does I need resend the request when I set authentication message?
And How to resend the request?
Is there somebody can help me?
Thanks.
Li Zhilong
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-12-26