I have this perl script that sends some headers and sends basic authentication to a url and then gets an xml file. I need to port this code to C, but i am unsure of how to send a GET http request with headers and basic authentication
Here is the PERL code
Code:
# Set up the header information for the request
my $headers = new HTTP::Headers
'Header 1' => $client_retsver,
'Header 1' => "Digest ".$client_retsauth;
my $ua = LWP::UserAgent->new;
$ua->agent($client_agent);
#my $request = HTTP::Request->new(GET => 'http://www.url.com', $headers);
$request->authorization_basic($user_userid,$user_password);
my $response = $ua->request($request);
Anyone have any ideas on how to port this over to C - is sockets the answer?