Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

Closed Issue: Exception: when request() is called with GET and body_send [4]

$
0
0
This is more of error checking than anything else. I inadvertently used methods::GET with body_data. I really wanted to use methods::POST.

test:

```
//
//this one will generate exception
//
http_client client(U("http://localhost"));
client.request(methods::GET, U("/"), U("blah=data")).then([=](http_response response)
{
wcout<<response.to_string();
}).wait();

//
//this one will work
//
http_client client(U("http://localhost"));
client.request(methods::POST, U("/"), U("blah=data")).then([=](http_response response)
{
wcout<<response.to_string();
}).wait();
```

Viewing all articles
Browse latest Browse all 4845

Trending Articles