Comments (7)
Quick Update:
I tried a simpler version to check if it's my use case, though the same issue (empty body, code 500, no sign of life from recipient of request) occurs. My new test case look like
int main(int argc, char *argv[], char *envp[])
{
RestClient::Response r = RestClient::post("http://127.0.0.1:8001/", "application/json", "invalid json");
// I would expect this to come back as a 500, but with some error message produced by the recipient
std::cout << "body: " << r.body << std::endl;
std::cout << "code: " << r.code << std::endl;
}
from restclient-cpp.
@andrewmfiorillo can you post the diagnostics information gotten from conn->GetInfo()
?
from restclient-cpp.
Can do!
baseUrl: http://6fmkd42:8001
basicAuth (usr,pass): (,)
certPath:
certType:
userAgent: foo/bar
followRedirects: 0
keyPath:
noSignal: 0
timeout: 1
lastRequest:
appConnectTime: 0
connectTime: 0.047
nameLookupTime: 0.031
preTransferTime: 0.047
redirectCount: 0
redirectTime: 0
startTransferTime: 0.047
totalTime: 0.047
Thanks!
from restclient-cpp.
it looks like your app is at least connecting. What does RestClient::Response.headers
say after the failed request?
from restclient-cpp.
"Content-Length" is 0, "Date" is my system's time in GMT, "HTTP/1.1 500 Internal Error" is "present", and "Server" is "Microsoft-HTTPAPI/2.0". That last one makes me think it's connecting to the inner server but that's rejecting the request outright. I'm going to do a quick test against httpbin.org.
Update: httpbin.org/post returned an OK 200 code, so I guess I'm now on the hunt via the recipient server. Thanks for your help @mrtazz.
from restclient-cpp.
A little bit more digging with RequestBin shows that restclient-cpp is working exactly as expected. My issue appears to be with the server it's trying to consume. Thanks again for your help, and thanks for the library!
from restclient-cpp.
@andrewmfiorillo glad to hear the client worked as expected! If you can think of anything that makes debugging easier in such a situation, feel free to open an issue for that.
from restclient-cpp.
Related Issues (20)
- IPv6 Bind
- Better cmake integration
- Disable SSL peer validation
- How to pass in parameters
- How to deal with this type of data?get method
- valgrind HOT 1
- Basic Post Request isn't working
- Proxy tunnel is enabled on all connections
- Request URL changes if I execute it in different thread
- How to set custom certificate in client? HOT 1
- Support body in delete
- Connection::post() seems to send deformed data
- RestClient::Response reassignment is null
- coud not support the asynchronous non-blocking send? curl_multi_perform
- does it support http2 now? HOT 1
- async get/post function support?
- librestclient-cpp.so HOT 1
- Release 0.5.3
- move release automation to GitHub actions
- Export symbols on Windows when building shared library
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from restclient-cpp.