HTTP Post data in raw?

As far as I known the HTTP | Drafts Script Reference (getdrafts.com) request only accepts json or form for data.

In my case the server needs raw. (I’m playing with Zotero web api). Similar question seems to be there but no answers. Can I ‘POST’ Raw Data to a Web API? - Scripting - Drafts Community (getdrafts.com)

I did a quick code review, and no, that’s not currently supported. Would not be too big a change, I will try to get this modification incorporated.

Do you have a specific example of a request/response you need to make (maybe a curl example)?

Sorry for the late reply. For Zotero Web API, the write item requests needs data to be passed as json array.

dev:web api:v3:write requests [Zotero Documentation]

I don’t see the need for raw here immediately, but I might be missing something.

The HTTP object handles JSON for sending and receiving…in fact, it is the default behavior. Just use your JavaScript object as the data param, as in the example code on the scripting reference page. JSON seems to be what the Zotero API is sending and receiving.

The API also sends back JSON, so the HTTP response will handle parsing that to a JavaScript object for you, and it will be in the responseData properly of the HTTPResponse.

Hi, sorry for the misleading. I’ll give it a try again. :grinning: