Received different status codes on Windows and OS X cpprest library by same request

Dec 1, 2015 at 8:21 AM
Edited Dec 1, 2015 at 9:35 AM
I'm working with OneNote API. After request create new page, response status code is different on Windows and MAC OS X libraries version. On Windows status is 'Created' but on MAC OS X status is 'BadRequest'. Used library version is 2.7. In an earlier version is the same behavior.
What's can be wrong and how to fix 'BadRequest'?

Please help me.

Here is my code:
void OneNote::export(const std::string& contentType, const std::string& contentBody)
    http_client_config clientConfig;


    http_client api(U(""), clientConfig);

    http_request request(methods::POST);

    request.set_body(contentBody, contentType);

    api.request(request).then([this](http_response response)
        // On Windows status is 'Created'
        // On MAC OS X status is 'BadRequest'
        http::status_code status = response.status_code();
Dec 2, 2015 at 11:39 AM
Edited Dec 2, 2015 at 11:40 AM
Fixed by removing port from "Host" in request for OS X library.