Example of endpoint that use GET Request with body
-
Clone the repository:
git clone https://github.com/rybalkin-an/get-with-body.git
-
Install dependencies
./gradlew build
-
If you have installed Java 17 and Gradle 8.3 on you PC:
./gradlew build
./gradlew bootRun
If you don't have JAVA you can run application inside a Docker container:
-
Build the Docker image using the Dockerfile:
docker build https://github.com/rybalkin-an/get-with-body.git -t image-name:latest
-
Run the container:
docker run -p 8080:8080 image-name
The application will start on http://localhost:8080.
Request method: GET <= Request
Request URI: http://localhost:8080/api/getExample
Proxy: <none>
Request params: <none>
Query params: <none>
Form params: <none>
Path params: <none>
Headers: Content-Type=text/plain
Cookies: <none>
Multiparts: <none>
Body:
someText
200 <= Response
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 49
Response from GET request with body: someText
Request method: POST <= Request
Request URI: http://localhost:8080/api/postExample
Proxy: <none>
Request params: <none>
Query params: <none>
Form params: <none>
Path params: <none>
Headers: Content-Type=text/plain
Cookies: <none>
Multiparts: <none>
Body: <none>
200 <= Response
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 39
Response from POST request without body
./gradlew test
- Spring Boot - The web framework used
- Gradle - Build and dependency management tool
- RestAssured - Testing and validating REST services