On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTFiles-32
RTIP-32
RTIP-32 Programming Manual
RTIP-32 Reference Manual
RTIP-32 Configuration
Socket API
Simplified Networking API
Extended RTIP-32 API
PPP
DHCP Client
DHCP Server
FTP Client
FTP Server
TFTP Client
TFTP Server
Telnet Client
Telnet Server
Web Server
Configuration
Function XN_REGISTER_WEB_SRV
Function http_find_string_value
Function http_mime_fields
Function http_ssi_files
Function http_add_get_functions
Function http_add_post_functions
Function http_server_daemon
Function https_server_daemon
Function http_set_auth
Function http_set_browser_list
Function xn_line_get
Function xn_line_put
Function get_function_entry
Function post_function_entry
Function http_set_put_function
Function http_set_delete_function
Function http_hostnames
SNMP Client
POP3 Client
SMTP Client
SNTP Client
SMB Server
SMB Client
SMB3 Server
SMB3 Client
WLAN Driver
Error Codes
RTPEG-32
RTUSB-32
|
Function http_set_put_function
This function is used to supply a custom application handler for HTTP PUT requests:
typedef int (*http_put_function)(PIO_CONTEXT io_context, const char * filename, long len);
void http_set_put_function(http_put_function function_ptr);
Parametersfunction_ptrPointer to a function of the application to handle PUT requests.
Only one application PUT handler can be installed. It will be called for every received PUT request. Its parameter filename points to the local part of the URL in the request. Parameter len specifies the Content-Length header value of the request. The handler can use functions xn_line_get to read the request body and xn_line_put to send a response.
The handler can return one of the following values:
Value |
Meaning |
-1 |
The request has been handled completely. The server will take no further actions. |
0 |
The request was not handled. The server should handle it. |
2 |
Server shall reply: "HTTP/1.1 200 File upload OK\r\n" |
3 |
Server shall reply: "HTTP/1.1 200 File deleted OK\r\n" |
4 |
Server shall reply: "HTTP/1.1 304 Not Modified\r\n\r\n" |
5 |
Server shall reply: "HTTP/1.1 400 Malformed Get request\r\n\r\n<H1>Malformed GET request</H1>" |
6 |
Server shall reply: "HTTP/1.1 401 Unauthorized" |
7 |
Server shall reply: "HTTP/1.1 403 Forbidden" |
8 |
Server shall reply: "HTTP/1.1 404 The requested URL was not found\r\n\r\n<H1>404 Not Found</H1>" |
9 |
Server shall reply: "HTTP/1.1 501 Command not implemented\r\n\r\n" |
Web Server
Function post_function_entry
Function http_set_delete_function
|