Giter Club home page Giter Club logo

Comments (7)

afiorillo avatar afiorillo commented on May 26, 2024

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.

mrtazz avatar mrtazz commented on May 26, 2024

@andrewmfiorillo can you post the diagnostics information gotten from conn->GetInfo()?

from restclient-cpp.

afiorillo avatar afiorillo commented on May 26, 2024

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.

mrtazz avatar mrtazz commented on May 26, 2024

it looks like your app is at least connecting. What does RestClient::Response.headers say after the failed request?

from restclient-cpp.

afiorillo avatar afiorillo commented on May 26, 2024

"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.

afiorillo avatar afiorillo commented on May 26, 2024

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.

mrtazz avatar mrtazz commented on May 26, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.