rob
April 8, 2019, 8:56am
1
In a script I’m making a Request
with this body
:
request.body = { "userName": "myUsername", "password": "myPassword" }
When I output the request using console.log
I indeed see this:
..., "body: {"password":"myPassword", "userName":"myUsername"}, ...
However, when performing the request the server returns a 503. When I inspect the actual communication with Charles Proxy for iOS the request body is entirely empty…
@simonbs Is this a bug / known issue?
I have this behaviour with the App Store release and the latest beta
what’s your request.method?
rob
April 8, 2019, 10:18am
4
Oops. Just remembered this:
Thank you so much for posting this!
I have been failing to put a proper body in a PUT request for at least half an hour, but now I can (use Scriptable to let IFTTT generate push notifications - to test them)
rob
April 8, 2019, 11:14am
5
Actually in this case that did not seem to help, but just using a string did:
request.body = "userName=" + username + "&password=" + password
I tried to inline it like this, but that did not work:
request.body = "userName=${username}&password=${password}"
Does Scriptable support inlining variables? How?
Try using back ticks for string wrapping with inline variables.
3 Likes