Using curl for communications

Deals with generic topics such as logging, framework and so on. If you are not sure where to place your topic just put it here.
Post Reply
koos@hsf.nl
Posts: 2
Joined: Thu Apr 15, 2021 8:09 am

Using curl for communications

Post 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
Joost
Posts: 307
Joined: Fri Apr 25, 2014 1:46 pm

Re: Using curl for communications

Post 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
Joost Claessen
Senior Technical Consultant
PTV Benelux
koos@hsf.nl
Posts: 2
Joined: Thu Apr 15, 2021 8:09 am

Re: Using curl for communications

Post by koos@hsf.nl »

Thank you, the -u did the trick. Now i get more respons and can continue.
Post Reply