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

Closed Issue: Fix docs for http_request constructor [273]

$
0
0
From discussion: https://casablanca.codeplex.com/discussions/567445#post1304756

When using API methods, one usually use a http_request with one of the API methods such as GET, POST etc.
I would like to know why the lines below works and what happens when no method name is passed to the request?
```
web::http::http_request request;
client.request(request);
web::http::http_response response = client.request(request).get();
```

I know that the status code is OK:
```
cout << "response.status_code() << endl;
```

The http_request class has one constructor with no method as parameter. The summary however tells that the method need to be given:
```
/// <summary>
/// Constructs a new HTTP request with the given request method.
/// </summary>
/// <param name="method">Request method.</param>
http_request()
: _m_impl(std::make_shared<http::details::_http_request>()) {}
```


Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>