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

Dec 1, 2015 at 7:21 AM
Edited Dec 1, 2015 at 8:35 AM
Hi.
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.
Thanks.

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

    clientConfig.set_oauth2(m_oauth2Config);

    http_client api(U("https://www.onenote.com/api/v1.0/pages/"), 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();
            
    }).wait();
}
Dec 2, 2015 at 10:39 AM
Edited Dec 2, 2015 at 10:40 AM
Fixed by removing port from "Host" in request for OS X library.