Commit 33e769bd authored by Evelyn's avatar Evelyn Committed by GitHub

Update mg_connect_http.md

parent 992f3000
...@@ -10,13 +10,13 @@ signature: | ...@@ -10,13 +10,13 @@ signature: |
const char *post_data); const char *post_data);
--- ---
Helper function that creates outbound HTTP connection. Helper function that creates an outbound HTTP connection.
`url` is a URL to fetch. It must be properly URL-encoded, e.g. have `url` is a URL to fetch. It must be properly URL-encoded, e.g. have
no spaces, etc. By default, `mg_connect_http()` sends Connection and no spaces, etc. By default, `mg_connect_http()` sends the Connection and
Host headers. `extra_headers` is an extra HTTP headers to send, e.g. Host headers. `extra_headers` is an extra HTTP header 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 a GET request is created. Otherwise, a POST request
is created with the specified POST data. Note that if the data being posted 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 is a form submission, the `Content-Type` header should be set accordingly
(see example below). (see example below).
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment