0

I cannot for the life of me figure out how to append the headers to my get request.

    var session = new Soup.Session ();
    
    var msg = new Soup.Message (
      "GET", 
      "some-api-key"
    );

    session.send_message (msg);

    print ("Message: %s", (string) msg.response_body.data);

I can't find any examples for how to do this. It's a miracle I made it this far.

0

msg.request_headers.append ("Content-Type", "application/json");

| improve this answer | |
  • It is the right answer, but it's also nice to include some resources, where OP can find more details, like valadoc MessageHeaders. – Vlad Pop Jul 31 at 8:47
  • Thanks for this, sorry I answered my own question. I should have linked to some resources. – Brendan Jul 31 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.