Hi Steve,
Thanks again for the useful information. Here is my latest code:
Gary
Thanks again for the useful information. Here is my latest code:
http_client client(U("https://api.prosper.com"));
http_request req(methods::POST);
req.headers().add(header_names::authorization, U("Basic EncodedStringHere"));
req.headers().add(header_names::content_type, U("application/x-www-form-urlencoded"));
uri_builder myBuilder(U("api/Invest"));
myBuilder.append_query(L"listingId", L"2588100");
myBuilder.append_query(L"amount", L"25.00");
req.set_request_uri(myBuilder.to_uri());
http_response response = client.request(req).get();
if(response.status_code() == status_codes::OK)
{
auto body = response.extract_string();
AfxMessageBox(CString(body.get().c_str()));
}
else {
CString errorString;
errorString.Format("Error Code: %d", response.status_code());
AfxMessageBox(errorString);
}
Still getting a return code of 400. If you or anyone else sees any flaws in the code, please let me know. Otherwise, I think I'll just put the project aside and keep making the loans manually for now.Gary