Skip to content

Request

h@di edited this page Jul 20, 2018 · 1 revision
Request(std::string method = "GET")
  • method can be "GET" and "POST".

Request-Line

You can access and modify contents of Requset-Line using following functions:

  • Method getMethod()
enum Method { GET, POST };
  • std::string getPath()
  • void setPath(std::string)

Query

You can access and modify contents of Query using following functions:

  • std::string getQueryString(): ?-started, &-separated url-encoded query string
  • std::string getQueryParam(std::string key)
  • void setQueryParam(std::string key, std::string value, bool encode = true)

Haeder

You can access and modify contents of Header using following functions:

  • std::string getHeader(std::string key)
  • cimap getHeaders(): cimap is a Case-Insensitive std::map<std::string, std::string>
  • void setHeader(std::string key, std::string value, bool encode = true)

Body

You can access and modify contents of Body using following functions:

  • std::string getBody() And for application/x-www-form-urlencoded requests:
  • std::string getBodyParam(std::string key)
  • void setBodyParam(std::string key, std::string value, bool encode = true)

AP HTTP

Clone this wiki locally