Skip to content

rybalkin-an/get-with-body

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GET Request with body

Example of endpoint that use GET Request with body

Table of Contents

Installation

  1. Clone the repository:

    git clone https://github.com/rybalkin-an/get-with-body.git
  2. Install dependencies

    ./gradlew build

Run the Application

  1. 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:

  1. Build the Docker image using the Dockerfile:

    docker build https://github.com/rybalkin-an/get-with-body.git -t image-name:latest
  2. Run the container:

    docker run -p 8080:8080 image-name

The application will start on http://localhost:8080.

Usage

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

Tests

./gradlew test

Built With

  • Spring Boot - The web framework used
  • Gradle - Build and dependency management tool
  • RestAssured - Testing and validating REST services

About

Example of endpoint that use GET Request with body

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published