2016-12-07 22:09:57 +01:00
|
|
|
/***************************************************************************
|
|
|
|
qgsserverrequest.h
|
|
|
|
|
2016-12-14 12:43:00 +01:00
|
|
|
Define request class for getting request contents
|
2016-12-07 22:09:57 +01:00
|
|
|
-------------------
|
|
|
|
begin : 2016-12-05
|
|
|
|
copyright : (C) 2016 by David Marteau
|
|
|
|
email : david dot marteau at 3liz dot com
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \ingroup server
|
|
|
|
* QgsServerRequest
|
2016-12-14 12:43:00 +01:00
|
|
|
* Class defining request interface passed to services QgsService::executeRequest() method
|
2016-12-07 22:09:57 +01:00
|
|
|
*/
|
2016-12-14 12:43:00 +01:00
|
|
|
|
2016-12-07 22:09:57 +01:00
|
|
|
class QgsServerRequest
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsserverrequest.h"
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum Method {
|
|
|
|
HeadMethod, PutMethod, GetMethod, PostMethod, DeleteMethod
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
2016-12-14 19:17:57 +01:00
|
|
|
* @param url the url string
|
2016-12-07 22:09:57 +01:00
|
|
|
* @param method the request method
|
|
|
|
*/
|
|
|
|
QgsServerRequest( const QString& url, Method method );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
|
|
|
* @param url QUrl
|
2016-12-14 12:43:00 +01:00
|
|
|
* @param method the request method (default to GetMethod)
|
2016-12-07 22:09:57 +01:00
|
|
|
*/
|
2016-12-14 12:43:00 +01:00
|
|
|
QgsServerRequest( const QUrl& url, Method method = GetMethod );
|
2016-12-07 22:09:57 +01:00
|
|
|
|
|
|
|
//! destructor
|
|
|
|
virtual ~QgsServerRequest();
|
|
|
|
|
2016-12-14 14:05:39 +01:00
|
|
|
/**
|
|
|
|
* @return the value of the header field for that request
|
|
|
|
*/
|
|
|
|
virtual QString getHeader( const QString& name ) const;
|
|
|
|
|
2016-12-07 22:09:57 +01:00
|
|
|
/**
|
2016-12-14 12:43:00 +01:00
|
|
|
* @return the request url
|
2016-12-07 22:09:57 +01:00
|
|
|
*/
|
2016-12-14 12:43:00 +01:00
|
|
|
virtual QUrl url() const;
|
2016-12-07 22:09:57 +01:00
|
|
|
|
|
|
|
/**
|
2016-12-14 12:43:00 +01:00
|
|
|
* @return the request method
|
2016-12-07 22:09:57 +01:00
|
|
|
*/
|
|
|
|
virtual Method method() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return post/put data
|
2016-12-14 12:43:00 +01:00
|
|
|
* Check for QByteArray::isNull() to check if data
|
|
|
|
* is available.
|
2016-12-07 22:09:57 +01:00
|
|
|
*/
|
2016-12-14 12:43:00 +01:00
|
|
|
virtual QByteArray data() const;
|
2016-12-07 22:09:57 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|