I've wrote some code based on httpexampleclient from sdk.
I send http request to IIS server, uri contains link to some file from server. When I use GET request than it works fine I can download this file without problems. If I use POST request and turn on authorization on IIS server than it fails. Message EGotResponseBodyData, GetNextDataPart returns:
I've checked, that's beginning of the message that authorization failed.
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\r\n<html dir=ltr>\r\n\r
No idea what's that, file which I try to download contains just simply text: 'testtext'.
Sending post request to this server, when authorization is turned off - works fine.
httpHeaders = iHttpTransaction.Request().GetHeaderCollection();
SetHeaderL(httpHeaders, HTTP::EUserAgent, KUserAgent);
SetHeaderL(httpHeaders, HTTP::EAccept, KAccept);
SetHeaderL(httpHeaders, HTTP::EUsername, _L8("user"));
SetHeaderL(httpHeaders, HTTP::EPassword, _L8("password"));
SetHeaderL(RHTTPHeaders aHeaders, TInt aHeaderField, const TDesC8& aHeaderValue)
RStringF valStr = iHttpSession.StringPool().OpenFStringL(aHeaderValue);
THTTPHdrVal val(valStr); aHeaders.SetFieldL(iHttpSession.StringPool().StringF(aHeaderField,RHTTPSession::GetTable()), val);
GET request - works fine with authorization (GetCredetentials is called).
When I try to download this file using 'normal' browser (like firefox or opera) I get question about username/password and it works fine. But when I prepared some html form with action='post' than the same problem like in my symbian application.
It seems that POST request has some problems with calling autorization event (GetCredetentials is not called in symbian, in browser is no window with username/password)
I'm testing it on emulator S60 FP1.