mirror of
https://github.com/curl/curl.git
synced 2024-12-09 06:30:06 +08:00
CURLOPT_POSTFIELDS.3: fix incorrect C string escape in example
- Escape inner quotes with two backslashes. Two backslashes escapes the backslash for the man page and will show as a single backslash. eg: "{\\"name\\": \\"daniel\\"}" shows as "{\"name\": \"daniel\"}". Closes https://github.com/curl/curl/pull/12588
This commit is contained in:
parent
296cb805cf
commit
9faeebca88
@ -97,7 +97,7 @@ int main(void)
|
||||
/* send an application/json POST */
|
||||
curl = curl_easy_init();
|
||||
if(curl) {
|
||||
const char *json = "{\"name\": \"daniel\"}";
|
||||
const char *json = "{\\"name\\": \\"daniel\\"}";
|
||||
struct curl_slist *slist1 = NULL;
|
||||
slist1 = curl_slist_append(slist1, "Content-Type: application/json");
|
||||
slist1 = curl_slist_append(slist1, "Accept: application/json");
|
||||
|
Loading…
Reference in New Issue
Block a user