Hi! I’ve been experimenting with talking with APIs using GJS and Soup. However, some require that I set headers for my requests. I see no documentation about setting headers on Messages or while calling send_and_read. Here is a portion of my code so far:
const uri = GLib.Uri.build(null, 'https://', null, apiHost, apiPort, `${apiPath}${endpoint}`, params, null);
const message = Soup.Message.new_from_uri('POST', uri);
message.set_request_body_from_bytes('application/json', messageBody);
// Set headers for the message?
const response = await session.send_and_read(message, null);
Thanks in advance!