Skip to content
Permalink
Browse files
Remove server url from path. Some server reject such requests
git-svn-id: http://svn.osgeo.org/qgis/trunk@9696 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Nov 24, 2008
1 parent fd60ebd commit 6d8848a47962a51ad8e1ae59c62efa5bb1d23b70
Showing with 4 additions and 7 deletions.
  1. +4 −7 src/core/qgshttptransaction.cpp
@@ -113,22 +113,19 @@ bool QgsHttpTransaction::getSynchronously( QByteArray &respondedContent, int red
// includes the scheme, host and port (the
// http://www.address.bit:80), so remove that from the url before
// executing an http GET.
//
// gsherman 2008-10-24 - Not sure if the above still holds true. Commenting
// out the removal for testing purposes
// QString pathAndQuery = httpurl.remove( 0,
// httpurl.indexOf( qurl.path() ) );

QString pathAndQuery = httpurl.remove( 0, httpurl.indexOf( qurl.path() ) );


if ( !postData ) //do request with HTTP GET
{
header.setRequest( "GET", httpurl );
header.setRequest( "GET", pathAndQuery );
// do GET using header containing user-agent
httpid = http->request( header );
}
else //do request with HTTP POST
{
header.setRequest( "POST", httpurl );
header.setRequest( "POST", pathAndQuery );
// do POST using header containing user-agent
httpid = http->request( header, *postData );
}

0 comments on commit 6d8848a

Please sign in to comment.