Skip to content
Permalink
Browse files
[server] Add url and post data getters to request handler
This completes the API to eventually get rid of all
getEnv usage from python server plugins.

The request handler has now access to the request URL
and POST data without the need to query the env.
  • Loading branch information
elpaso committed May 16, 2017
1 parent e3d79a1 commit 2f75bab84414fec257e45d3f92a1e82dc2becdc2
Showing with 16 additions and 0 deletions.
  1. +10 −0 src/server/qgsrequesthandler.cpp
  2. +6 −0 src/server/qgsrequesthandler.h
@@ -121,6 +121,16 @@ QByteArray QgsRequestHandler::body() const
return mResponse.data();
}

QByteArray QgsRequestHandler::data() const
{
return mRequest.data( );
}

QString QgsRequestHandler::url() const
{
return mRequest.url( ).toString( );
}

void QgsRequestHandler::setStatusCode( int code )
{
mResponse.setStatusCode( code );
@@ -104,6 +104,12 @@ class SERVER_EXPORT QgsRequestHandler
//! Return response body data
QByteArray body() const;

//! Return request POST data (can be null)
QByteArray data() const;

//! Return request url
QString url() const;

//! Set response http status code
void setStatusCode( int code );

0 comments on commit 2f75bab

Please sign in to comment.