HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HOM_WebServerRequest.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * COMMENTS:
7  */
8 
9 #ifndef __HOM_WebServerRequest_h__
10 #define __HOM_WebServerRequest_h__
11 
12 #include "HOM_API.h"
13 #include "HOM_Defines.h"
14 #include "HOM_Errors.h"
15 #include "HOM_Module.h"
16 #include "HOM_ElemPtr.h"
18 #include <NET/NET_HTTPRequest.h>
19 #include <stdexcept>
20 
21 SWIGOUT(%rename(WebServerRequest) HOM_WebServerRequest;)
22 
24 {
25 public:
28  : myRequest(request)
29  { HOM_CONSTRUCT_OBJECT(this) }
30 
32  { HOM_DESTRUCT_OBJECT(this) }
33 
35 
37  { return myRequest.method().toStdString(); }
38 
40  { return myRequest.path().toStdString(); }
41 
43  { return myRequest.queryString().toStdString(); }
44 
46  { return myRequest.body().toStdString(); }
48  { return myRequest.contentType().toStdString(); }
50  { return myRequest.contentLength().toStdString(); }
52  { return myRequest.protocol().toStdString(); }
54  { return myRequest.host().toStdString(); }
55 
56  std::map<std::string, std::string> headers();
57  std::map<std::string, std::string> POST();
58  std::map<std::string, std::string> GET();
59  std::map<std::string, std::string> cookies();
60  std::map<std::string, HOM_ElemPtr<HOM_WebServerUploadedFile> > files();
61 
62  bool isSecure()
63  { return myRequest.isSecure(); }
64 
65  int port()
66  { return myRequest.myPort; }
67 
68  SWIGOUT(%ignore myRequest;)
69  NET_HTTPRequest myRequest;
70 };
71 
72 #endif
#define HOM_DESTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1210
OIIO_API bool rename(string_view from, string_view to, std::string &err)
#define SWIGOUT(x)
Definition: HOM_Defines.h:24
string __repr__(VtArray< T > const &self)
Definition: wrapArray.h:349
#define HOM_API
Definition: HOM_API.h:13
#define HOM_CONSTRUCT_OBJECT(pointer)
Definition: HOM_Module.h:1209
GLsizei const GLchar *const * string
Definition: glew.h:1844
HOM_WebServerRequest(const NET_HTTPRequest &request)