CURL to networkRequest()

I’m currently converting some CURL requests to a format suitable for use with network.request()

I’m probably just tired and totally stepping on it, but starting with this (fake URL and token):

curl --request POST \ --url 'http://fake.url.com/api/public/v1/token' \ --header 'Authorization: Basic ABCDEFG12345678abcdefg0987654321'

I translate to this:

local req = {} req.timeout = 30 req.headers = {} req.headers.Authorization = 'Basic ABCDEFG12345678abcdefg0987654321' --req.body = json.encode({}} network.request( 'http://fake.url.com/api/public/v1/token', "POST", listener, req)

Am I doing something stupid?  I feel I am, but I’m too close to the problem to see it right now.

Note: I’m getting a 500 back from the real server I’m testing against.  (I wish I had access to the logs because it would probably be clear what I’m messing up from them.)

Note 2: The worst part is, I had this working earlier (with real URL and token), but then didn’t save my code before making changes.  Ugh!  -_-

*CLOSED*

Well folks, it looks like the encoding above was correct.  Soon after posting here, the Admin contacted me and it turns out a scan was running on the server that was sucking up all the resources.

Cheers!

*CLOSED*

Well folks, it looks like the encoding above was correct.  Soon after posting here, the Admin contacted me and it turns out a scan was running on the server that was sucking up all the resources.

Cheers!