mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-13 17:00:19 +00:00
Add a note about Content-Type for form submissions
PUBLISHED_FROM=6079258be24fa0255f5a58e4d364be224435394b
This commit is contained in:
1 parent
d9b9d71b2d
commit
5d6eeb5d1d
1 file changed
+9
-3
+9
-3
@@ -1804,15 +1804,21 @@ int mg_http_create_digest_auth_header(char *buf, size_t buf_len,
|
|||||||
* Host headers. `extra_headers` is an extra HTTP headers to send, e.g.
|
* Host headers. `extra_headers` is an extra HTTP headers to send, e.g.
|
||||||
* `"User-Agent: my-app\r\n"`.
|
* `"User-Agent: my-app\r\n"`.
|
||||||
* If `post_data` is NULL, then GET request is created. Otherwise, POST request
|
* If `post_data` is NULL, then GET request is created. Otherwise, POST request
|
||||||
* is created with the specified POST data. Examples:
|
* is created with the specified POST data. Note that if the data being posted
|
||||||
|
* is a form submission, the `Content-Type` header should be set accordingly
|
||||||
|
* (see example below).
|
||||||
|
*
|
||||||
|
* Examples:
|
||||||
*
|
*
|
||||||
* [source,c]
|
* [source,c]
|
||||||
* ----
|
* ----
|
||||||
* nc1 = mg_connect_http(mgr, ev_handler_1, "http://www.google.com", NULL,
|
* nc1 = mg_connect_http(mgr, ev_handler_1, "http://www.google.com", NULL,
|
||||||
* NULL);
|
* NULL);
|
||||||
* nc2 = mg_connect_http(mgr, ev_handler_1, "https://github.com", NULL, NULL);
|
* nc2 = mg_connect_http(mgr, ev_handler_1, "https://github.com", NULL, NULL);
|
||||||
* nc3 = mg_connect_http(mgr, ev_handler_1, "my_server:8000/form_submit/",
|
* nc3 = mg_connect_http(
|
||||||
* NULL, "var_1=value_1&var_2=value_2");
|
* mgr, ev_handler_1, "my_server:8000/form_submit/",
|
||||||
|
* "Content-Type: application/x-www-form-urlencoded\r\n",
|
||||||
|
* "var_1=value_1&var_2=value_2");
|
||||||
* ----
|
* ----
|
||||||
*/
|
*/
|
||||||
struct mg_connection *mg_connect_http(struct mg_mgr *mgr,
|
struct mg_connection *mg_connect_http(struct mg_mgr *mgr,
|
||||||
|
|||||||
Reference in new issue
Block a user