Git Product home page Git Product logo

Comments (4)

jgaa avatar jgaa commented on July 26, 2024 1

I have not implemented dedicated support for cookies yet. It will be done soon. The last few weeks I have worked on another project, including some Jenkins CI work.
Currently it's too much work to test new features on all the platforms I support with restc-cpp. That has held the progress back.
One of the next days I will setup automatic builds and tests for all the platforms supported, and after that I will fix the bugs and move the project forward.

from restc-cpp.

01e9 avatar 01e9 commented on July 26, 2024

I just found that restbed has a http client (this is my workaround).
Much simpler to use and has a get_headers() method that returns a multimap.

std::string uri {"http://localhost/test"};
std::string body {"{\"foo\":\"bar\"}"}

auto request = std::make_shared<restbed::Request>(restbed::Uri{uri});
request->set_method("POST");
request->set_headers({{"Content-Length", std::to_string(body.size())}});
request->set_body(body);

auto response {restbed::Http::sync(request)};

auto cookieHeaders {response->get_headers("Set-Cookie")};

std::string responseBody {
    restbed::String::to_string(
        restbed::Http::fetch(
            std::stoi(response->get_header("Content-Length")), 
            response
        )
    )
};

from restc-cpp.

01e9 avatar 01e9 commented on July 26, 2024

I have not implemented dedicated support for cookies yet.

I haven't asked support for cookies. It's just an example of multi-header value.

from restc-cpp.

jgaa avatar jgaa commented on July 26, 2024

Yes, I'll fix that as well :)
Cookies has been on my list for a while, I just never needed it myself.

from restc-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.