Skip to content

Response

h@di edited this page Jul 20, 2018 · 1 revision
Response(int code = 200)
  • code can be any HTTP or userd-defined response code

Status-Line

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

  • int getStatusCode()
  • std::string getStatusPhrase()
  • void setStatus(int code, std::string phrase = ""): automatically assigns phrase based on code if not provided and code is known to class

Also, status of response can be specified when creating an object of Response by optional parameter int code of its constructor. Otherwise, status 200 OK will be assigned to created object.

Header

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

  • std::string getHeader(std::string name)
  • void setHeader(std::string name, std::string value)

Body

You can modify contents of Body using following function:

  • void setBody(std::string _body)

AP HTTP

Clone this wiki locally