[FrontPage] [TitleIndex] [WordIndex

Testing HTTP Communcation on the commandline

1. Using a commandline based HTTP Client

For sending HTTP request via the commandline, there are 2 tools 'wget' and 'curl'. For sending HTTP GET request wget is good enough. For more sophisticated stuff use curl. For instance, if you like to send XML documents to a deegree service, do the following:

curl -v -X POST -H "Content-type: text/xml" http://localhost:8054/owsproxy/proxy -d @getfeature+user.xml

-v verbose
-X specifies transfer methode explicitly (implicit in -d)
-H setting the content-type explicitly (that makes the difference to wget)
-d send the XML document; reference it with "@"

Combining it with a pretty print, you could use xmllint:

curl -v -X POST -H "Content-type: text/xml" http://localhost:8054/owsproxy/proxy -d @getfeature+user.xml|xmllint --format -

--format formating the XML output
'-' reading from STDIN



2018-04-20 12:04