Microservices
This section includes tutorials, tips and tricks about microservices and Rest API’s.
Testing using Postman
Prerequisite
-
Download PostMan.
-
To be able to apply the steps in this tutorial, you will need to have a running microservice, we recommend building one using j-framework, check , Creating Simple Java Microservice using j-framework .
Instructions
1.Open Postman then click on new. image::postman/postman-home-screen.png[Postman Home]
2.Click on HTTP request. image::postman/http-request.png[HTTP Request]
3.GET request without parameter. image::postman/http-page.png[NO Params]
a.Select "GET"
b.Enter URL (e.g."http://localhost:8080/app/example/hello")
c.Click on send

You should see something like this .
4.GET with parameter
a.Select "GET"
b.Enter url (e.g."http://localhost:8080/app/example/hello/yourName")
c.Click on send

See the output in figure 5.
Make sure you use get "http://localhost:8080/app/example/hello/{name}". |
5.Using json "POST"
a.Select "POST"
b.Enter url (e.g."http://localhost:8080/app/example/hello")

c.Select Body ⇒ raw ⇒ JSON


d.Enter JSON string (e.g. {"name":"John", "age":30} )
e.Click on send

See the output in figure 9.