Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

On this section we propose som tools to test the REST API with some little tools - without the need to develop a REST consuming client application upfront.

Browser

PositiveFor instance Firefox displays JSON and XML in a very well readable format. 
Negative

A browser provides only limited control to tailor a request without further add-ons. Requests are sent as 

Mgnl get
 and you cannot add more request headers out of the box.

Tips
  • If you want to test on REST resources via 
    Mgnl get
    , which requires authetication (to get assigned roles not provided to anonymous user - login at Magnolia first, open a new tab on the same window (using the same session) and then requesting the REST resource.
  • Upgrade the browser with add-ons to extend its possibilities to controll the request.


 

cURL

cURL is a command line tool. It can be used on most of the well known operating systems. In this tutorial we will often test REST request via cURL.

Downloadhttps://curl.haxx.se/download.html
PositiveVery flexible to tailor the request (method, request headers, etc.). Response can be further processed.
NegativeNot everybody likes command line tools. The response is not reasy to read without further tooling. No out of the box automatic URL encoding.
Tips

On the first atempt of a request use the -i option to display all response headers.

If the response body is fine and delivers JSON, pretty print and colorize the response body with tools such as jq.



Swagger UI tools

.