|
24 | 24 | #include "restclient-cpp/restclient.h" |
25 | 25 |
|
26 | 26 | RestClient::Response r = RestClient::get("http://url.com") |
27 | | -RestClient::Response r = RestClient::post("http://url.com/post", "text/json", "{\"foo\": \"bla\"}") |
28 | | -RestClient::Response r = RestClient::put("http://url.com/put", "text/json", "{\"foo\": \"bla\"}") |
| 27 | +RestClient::Response r = RestClient::post("http://url.com/post", "application/json", "{\"foo\": \"bla\"}") |
| 28 | +RestClient::Response r = RestClient::put("http://url.com/put", "application/json", "{\"foo\": \"bla\"}") |
29 | 29 | RestClient::Response r = RestClient::del("http://url.com/delete") |
30 | 30 | RestClient::Response r = RestClient::head("http://url.com") |
31 | 31 | ``` |
@@ -84,9 +84,9 @@ RestClient::Response r = conn->head("/get") |
84 | 84 | RestClient::Response r = conn->del("/delete") |
85 | 85 |
|
86 | 86 | // set different content header for POST and PUT |
87 | | -conn->AppendHeader("Content-Type", "text/json") |
| 87 | +conn->AppendHeader("Content-Type", "application/json") |
88 | 88 | RestClient::Response r = conn->post("/post", "{\"foo\": \"bla\"}") |
89 | | -RestClient::Response r = conn->put("/put", "text/json", "{\"foo\": \"bla\"}") |
| 89 | +RestClient::Response r = conn->put("/put", "application/json", "{\"foo\": \"bla\"}") |
90 | 90 |
|
91 | 91 | // deinit RestClient. After calling this you have to call RestClient::init() |
92 | 92 | // again before you can use it |
|
0 commit comments