0

This command works fine if I paste into a command window directly:

curl -X POST -H "Content-type: application/json" --data "{\"text\":\"test\"}" --url "https://chat.googleapis.com/v1/spaces/[removed]/messages?key=[removed]&token=[removed]" 

yet when I execute this from within a batch file, I receive the following:

{ "error": { "code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT" } } 

I've tried every permutation of escaping the quotes in the json data statement with no luck.

1
  • Maybe try add -g switch ? Commented Mar 3, 2019 at 2:49

1 Answer 1

0

I found the issue - it's not even illustrated in the sample I posted as I had removed the URL. The issue related to a % symbol I had in the URL - in a batch script these need to be escaped by entering %% instead of %. Hope this saves someone the hours I wasted on such a stupid mistake. Thanks to those who reviewed or responded - sorry to have wasted your time :-(

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.