Page 1 of 1

Using curl for communications

Posted: Thu Apr 15, 2021 9:49 am
by koos@hsf.nl
Hello,

We are trying to get data from PTV using curl from our Linux server.

The request itself we test at the raw request runner and put in a file "/..../PTV_TEST4.TXT"
If we test with the command:

curl -X GET -H 'Authorization: username xtok' -H 'Authorization: password *token*' -H 'Content-Type: application/soap+xml;charset=utf-8' --data-binary @ '/........../PTV_TEST4.TXT' 'https://xserver2-europe-eu-test.cloud.p ... /ws/XRoute'

The respons is: curl: (3) <url> malformed

So there must be a small syntax problem in my command.

Can someone help me with the correct command to use with curl?

Thanks in Advance.

Greetings
Koos

Re: Using curl for communications

Posted: Thu Apr 15, 2021 11:35 am
by Joost
I'm not experienced with using curl, but going from the manual the command should be:

Code: Select all

curl-X POST -u xtok:<TOKEN> -H 'Content-Type: application/soap+xml;charset=utf-8' --data-binary @ '/........../PTV_TEST4.TXT' https://xserver2-europe-eu-test.cloud.ptvgroup.com/services/ws/XRoute
Only thing I'm not sure about is if I specify the file location correctly

Re: Using curl for communications

Posted: Thu Apr 15, 2021 11:54 am
by koos@hsf.nl
Thank you, the -u did the trick. Now i get more respons and can continue.