Open lastlink opened 4 years ago
After doing a copy curl from rest client I discovered that the --url doesn't work on windows while -L does work.
curl --request POST --url https://script.google.com/macros/s/xxx/exec --header 'content-type: application/json' --data '{}'
vs
curl --request POST -L https://script.google.com/macros/s/xxx/exec --header 'content-type: application/json' --data '{}'
@lastlink could you please provide the actual request that not working for you?
@macroId=AKfycbzTiRpq4ZqCSiR5JXbBQPtMUmwuRQbX-j4srBTnDIMDjQJywcs
###
POST https://script.google.com/macros/s/{{macroId}}/exec HTTP/1.1
Content-Type: application/json
{
"machineId": "asdf1234"
}
curl -d "" -L https://script.google.com/macros/s/AKfycbyW_I75HOxOrLhsm4x4ZJTF71VRP2-1Ey3gsijORAOywKGLG18/exec
Did you mean that when the request body is empty string in curl request that works for you? While in the above plain HTTP request, the request body is a JSON with machineId
. Can you curl still succeed with the same request body?
Steps to Reproduce:
Create a new project in google apps script Add this code to a script, publish with anonymous permission.
A curl works
curl -d "" -L https://script.google.com/macros/s/AKfycbyW_I75HOxOrLhsm4x4ZJTF71VRP2-1Ey3gsijORAOywKGLG18/exec
remove the "" and it gives similar incorrect response
curl -d -L https://script.google.com/macros/s/AKfycbyW_I75HOxOrLhsm4x4ZJTF71VRP2-1Ey3gsijORAOywKGLG18/exec
expected response
solution:
I suspect something changed in the vscode version or the body is not attaching properly.