idHTTP.post HTTP:/1.1 401 Authorization Required

idHTTP.post HTTP:/1.1 401 Authorization Required

Post by xood » Tue, 28 Mar 2006 15:41:30


Sorry for my english, im russian.

my fragment:

sRequest:='http://'+slogin+':'+spass+'@'+sss+'/upload.php'; //working url
ResponseStream := TMemoryStream.Create;
stream_send:=TIdMultiPartFormDataStream.Create;
stream_send.AddFile('ff','.\packout.zip','application/zip');
stream_send.Position := 0;
IdHttp1.Request.ContentType := stream_send.RequestContentType;
IdHTTP1.Post(sRequest, stream_send, ResponseStream);

without autorization it work good, but if server required authorization i
get error 401...

can someone help me? need any sample with using authorization.
 
 
 

idHTTP.post HTTP:/1.1 401 Authorization Required

Post by Team » Wed, 29 Mar 2006 04:10:22


The only way that can happen is if either

1) the user/pass combo that you are specifying is wrong to begin with

2) the server requires an authentication scheme that TIdHTTP does not
natively support. Are the OnSelectAuthorization and/or OnAuthorization
events being tiggered at all?


Gambit