pwired Posted August 10, 2015 Share Posted August 10, 2015 Hi,This is not directly related with processwire but coded relatedso I hope one of you skilled coders can help me out with this one.A friend is on mac an he can execute following command with parameterswithout any problems. He can even split the command over 5 linesby using a backslash \-X POST \ -H "X-Parse-Application-Id: abcdefghijklmnopqrstuvwz" \ -H "X-Parse-REST-API-Key: abcdefghijklmnopqrstuvwxyz" \ -H "Content-Type: application/json" \ -d '{"accounts": ["123456789"]}' \ https://api.domain.com/1/functions/checkAccountsI am on windows and as far as I can get I can only usecURL to execute the same command. First of all it seems with cURLI can not split the command over 5 lines with a backslash \but I have to put everything on a single line.Second I have to use the \ as an escape character in theJSON parameter: this won't work with cURL -d '{"accounts": ["123456789"]}'and I have to change it into -d "{\"accounts\": [\"123456789\"]}"to make it work with cURLI tried httpie and wget on windows but both do not accept the commandthe way it is executed on mac, also not the way cURL is accepting it. Besides cURL, httpie and wget, does anyone know a way how I can executethis command on windows the same way as my friend does on mac splitover different lines and without escape characters ? Link to comment Share on other sites More sharing options...
cstevensjr Posted August 10, 2015 Share Posted August 10, 2015 Sounds like you want to run a "LINUX/UNIX terminal" program on MS Windows. https://www.cygwin.com/ 1 Link to comment Share on other sites More sharing options...
pwired Posted August 10, 2015 Author Share Posted August 10, 2015 Thanks for that hint Charles, I downloaded and installed Cygwin and can execute all the commands as shown in the youtube video clip, just when I try to execute the command as above: -X POST \ -H "X-Parse-Application-Id: abcdefghijklmnopqrstuvwz" \ -H "X-Parse-REST-API-Key: abcdefghijklmnopqrstuvwxyz" \ -H "Content-Type: application/json" \ -d '{"accounts": ["123456789"]}' \ https://api.domain.c...s/checkAccounts I get a message thrown: -bash: -X: command not found Link to comment Share on other sites More sharing options...
LostKobrakai Posted August 10, 2015 Share Posted August 10, 2015 -X is not a command, maybe you want a "curl" in front of it. 2 Link to comment Share on other sites More sharing options...
pwired Posted August 10, 2015 Author Share Posted August 10, 2015 Copied curl.exe to C:\cygwin\bin\ Putting curl after the cygwin terminal prompt $ does it ! Now I can execute those commands exactly the same way as on mac: split over different lines with \ and without escape characters Thanks Charles and LostKobrakai 1 Link to comment Share on other sites More sharing options...
felix Posted August 10, 2015 Share Posted August 10, 2015 I'd recommend www.getpostman.com the next time you're trying to test api requests. 1 Link to comment Share on other sites More sharing options...
Jonathan Lahijani Posted August 12, 2015 Share Posted August 12, 2015 Look into using Babun, which is a pre-configured Cygwin: http://babun.github.io/ 2 Link to comment Share on other sites More sharing options...
Recommended Posts