Authentication



Hello

I need create request with Basic Authentication

My simple code:

SoupSession* session = soup_session_sync_new_with_options(SOUP_SESSION_USER_AGENT, "MyUserAgent");
SoupMessage *msg = soup_message_new ("GET", "http://test.com");   

SoupAuth* sAuth = soup_auth_new(SOUP_TYPE_AUTH_BASIC, msg, "Basic  realm=\"Test\"");
soup_auth_authenticate(sAuth, "aaa", "bbb");

guint  status = soup_session_send_message (session, msg);

But I send request without Authentication:

GET / HTTP/1.1
Host: test.com
User-Agent: MyUserAgent

 

What do I need to do? what do I lost?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]