views:

94

answers:

1

I have a project that uses wxCurl to retrieve a file over HTTP. However, if the server sends a 301 or 302, all I get back is an empty string. I heard there was a way to get cURL to follow the location: headers sent by the server. How is this done?

Also, how do you set the User-agent header in wxCurl?

A: 

Call mywxCurlHttpObject->SetOpt(CURLOPT_FOLLOWLOCATION, 1);

that will set the underlaying libCurl option correctly.

I don't know about the user agent -- you'd have to set that in the header in libCURL, but I don't see a way to set those with the wxCURL wrapper

RyanWilcox
Thanks for the example, but it didn't work - some deep searching in the source revealed nothing. I finally just used libCURL directly.
George Edison