-
Notifications
You must be signed in to change notification settings - Fork 12
Response
h@di edited this page Jul 20, 2018
·
1 revision
Response(int code = 200)-
codecan be any HTTP or userd-defined response code
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 assignsphrasebased oncodeif not provided andcodeis 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.
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)
You can modify contents of Body using following function:
void setBody(std::string _body)
AP HTTP
University of Tehran / Advanced Programming
- Quick How-to & Examples
- Creating a New Server
-
Request Handlers
- Serving Static Files
- Serving Dynamic Files
- Getting Data from Client-side
- Redirection
- Serving Template Files
- Template Files
-
Request- Request-Line
- Query
- Haeder
- Body
-
Response- Status-Line
- Header
- Body
- Session
- Utilities
- Compile and Run