Hi all
Hi all
I looked harder at the source code and discovered a very nice capability within the existing http_client_config class which worked a treat:
Very nice casablanca dev team - well done!
Jame
Hi all
I looked harder at the source code and discovered a very nice capability within the existing http_client_config class which worked a treat:
whttp::client::http_client_config config;
config.set_nativehandle_options([](web::http::client::native_handle handle) {
DWORD data = WINHTTP_DISABLE_REDIRECTS;
BOOL result = ::WinHttpSetOption(handle, WINHTTP_OPTION_DISABLE_FEATURE, &data, sizeof(data));
if (!result)
{
DWORD error = GetLastError();
}
});
utility::string_t baseUrl = _XPLATSTR("https://media.windows.net/api/");
whttp::client::http_client client(baseUrl, config);
Obviously this will only work for windows but if I face the same problem on linux then I guess I will use a similar technique to turn off automatic redirect.Very nice casablanca dev team - well done!
Jame








