{"action":"created","issue":{"url":"https://api.github.com/repos/curl/curl/issues/862","repository_url":"https://api.github.com/repos/curl/curl","labels_url":"https://api.github.com/repos/curl/curl/issues/862/labels{/name}","comments_url":"https://api.github.com/repos/curl/curl/issues/862/comments","events_url":"https://api.github.com/repos/curl/curl/issues/862/events","html_url":"https://github.com/curl/curl/issues/862","id":158640080,"number":862,"title":"Docs are not clear about zero-byte POST","user":{"login":"safinaskar","id":859494,"avatar_url":"https://avatars.githubusercontent.com/u/859494?v=3","gravatar_id":"","url":"https://api.github.com/users/safinaskar","html_url":"https://github.com/safinaskar","followers_url":"https://api.github.com/users/safinaskar/followers","following_url":"https://api.github.com/users/safinaskar/following{/other_user}","gists_url":"https://api.github.com/users/safinaskar/gists{/gist_id}","starred_url":"https://api.github.com/users/safinaskar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/safinaskar/subscriptions","organizations_url":"https://api.github.com/users/safinaskar/orgs","repos_url":"https://api.github.com/users/safinaskar/repos","events_url":"https://api.github.com/users/safinaskar/events{/privacy}","received_events_url":"https://api.github.com/users/safinaskar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/curl/curl/labels/documentation","name":"documentation","color":"f7c6c7"},{"url":"https://api.github.com/repos/curl/curl/labels/HTTP","name":"HTTP","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-06T09:51:03Z","updated_at":"2016-06-07T05:55:46Z","closed_at":null,"body":"I cannot understand from online docs at https://curl.haxx.se/libcurl/c/ how to do zero-byte POST. It seems docs should be fixed. Is the following code ok?\r\n\r\n```c\r\ncurl_global_init (CURL_GLOBAL_ALL);\r\nCURL *curl_handle = curl_easy_init ();\r\ncurl_easy_setopt (curl_handle, CURLOPT_URL, \"http://example.com\");\r\ncurl_easy_setopt (curl_handle, CURLOPT_POSTFIELDSIZE, 0L);\r\nCURLcode code = curl_easy_perform (curl_handle);\r\n```\r\n\r\nOr I should also set CURLOPT_POST or CURLOPT_POSTFIELDS?\r\nIs the following code ok? Does it really perform zero-byte POST?\r\n\r\n```c\r\ncurl_global_init (CURL_GLOBAL_ALL);\r\nCURL *curl_handle = curl_easy_init ();\r\ncurl_easy_setopt (curl_handle, CURLOPT_URL, \"http://example.com\");\r\ncurl_easy_setopt (curl_handle, CURLOPT_POSTFIELDS, NULL); // is this line ok???\r\ncurl_easy_setopt (curl_handle, CURLOPT_POSTFIELDSIZE, 0L);\r\nCURLcode code = curl_easy_perform (curl_handle);\r\n```"},"comment":{"url":"https://api.github.com/repos/curl/curl/issues/comments/224185991","html_url":"https://github.com/curl/curl/issues/862#issuecomment-224185991","issue_url":"https://api.github.com/repos/curl/curl/issues/862","id":224185991,"user":{"login":"bagder","id":177011,"avatar_url":"https://avatars.githubusercontent.com/u/177011?v=3","gravatar_id":"","url":"https://api.github.com/users/bagder","html_url":"https://github.com/bagder","followers_url":"https://api.github.com/users/bagder/followers","following_url":"https://api.github.com/users/bagder/following{/other_user}","gists_url":"https://api.github.com/users/bagder/gists{/gist_id}","starred_url":"https://api.github.com/users/bagder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bagder/subscriptions","organizations_url":"https://api.github.com/users/bagder/orgs","repos_url":"https://api.github.com/users/bagder/repos","events_url":"https://api.github.com/users/bagder/events{/privacy}","received_events_url":"https://api.github.com/users/bagder/received_events","type":"User","site_admin":false},"created_at":"2016-06-07T05:55:46Z","updated_at":"2016-06-07T05:55:46Z","body":"@safinaskar, you think @jay's version makes it clearer?"}}
{"actor":{"display_login":"bagder"}}