Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 17:00, 1 January 2008.

How to resolve 302 Redirect Status

From Forum Nokia Wiki

There is a default filter for redirect, so you must remove it to resolve 302 redirection. Otherwise you cannot receive 302 redirect header,location is null.


RHTTPFilterCollection filtColl = iSession.FilterCollection();
RStringF filterName = iSession.StringPool().StringF(HTTP::ERedirect,RHTTPSession::GetTable());
filtColl.RemoveFilter( filterName );
 
 
The Location header value in EGotResponseHeader event and you can do as below
 
RStringF location = iSession.StringPool().StringF(HTTP::ELocation,RHTTPSession::GetTable());
RHTTPHeaders responseHeaders( aTransaction.Response().GetHeaderCollection() );
THTTPHdrVal locationValue;					
if( responseHeaders.GetField(location, 0, locationValue) == KErrNone )
{
  TBuf8<255> urides( locationValue.StrF().DesC() );
  TUriParser8 uri;
  uri.Parse( urides  );
  aTransaction.Cancel();						
  iTransaction.Request().SetURIL( uri );
  iTransaction.SubmitL();
}
Related Discussions
Thread Thread Starter Forum Replies Last Post
Nmib Gateway? plkilroy Browsing and Mark-ups 0 2003-07-04 04:51
Socket connection to a remote server??? noussaENSI Symbian Networking & Messaging 14 2007-03-14 11:21
Nmib Gateway? plkilroy Browsing and Mark-ups 0 2003-07-04 04:51
Redirect neorgon General Browsing 0 2004-06-21 20:40
httpconnection doesn't support redirection? (urgent!) ekoprasetio Mobile Java Networking & Messaging & Security 1 2003-12-09 12:55
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX