Resources

Greeting REST Service

The Greeting provides the entry point into the service.

Accessing the greeting GET with provided content

Request structure

GET /greeting?name=Everybody HTTP/1.1
Host: localhost

Request parameters

Parameter Description

name

Greeting’s target

Response fields

Path Type Description

id

Number

Greeting’s generated id

content

String

Greeting’s content

optionalContent

String

Greeting’s optional content

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 38

{"id":2,"content":"Hello, Everybody!"}

CURL request

$ curl 'http://localhost:8080/greeting?name=Everybody' -i

Accessing the greeting GET with default content

Request structure

GET /greeting HTTP/1.1
Host: localhost

Response fields

Path Type Description

content

String

When name is not provided, this field contains the default value

Example response

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 34

{"id":1,"content":"Hello, World!"}

CURL request

$ curl 'http://localhost:8080/greeting' -i