https://github.com/namuan/print-rider
A simple API to publish API exchanges from HttpRider
https://github.com/namuan/print-rider
http-rider micronaut micronaut-java-application rest-api
Last synced: 11 months ago
JSON representation
A simple API to publish API exchanges from HttpRider
- Host: GitHub
- URL: https://github.com/namuan/print-rider
- Owner: namuan
- Created: 2019-12-21T06:41:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-10T21:12:13.000Z (about 3 years ago)
- Last Synced: 2025-02-02T08:28:15.017Z (over 1 year ago)
- Topics: http-rider, micronaut, micronaut-java-application, rest-api
- Language: Java
- Size: 97.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## API Print Service
A simple API to save API exchange and render as HTML.
### API Description
It consists of two endpoints.
#### Save API Print
Saves the `base64` encoded document and returns the location to retrieve the HTML.
##### Request
```
POST /prints
```
*Headers*
```
Content-Type: application/json
```
*Body*
```
{
"document": "IyMjIEhlYWRpbmc="
}
```
##### Response
```
HTTP 201
```
*Headers*
```
location: http://localhost:8080/prints/3f7d252e-5e4f-4232-ac48-e67b08ffffc0
```
*Sample Call*
```
curl -X 'POST' -H 'Content-Type: application/json' -d '{"document": "IyMjIEhlYWRpbmc="}' 'http://127.0.0.1:8080/prints'
```
#### Get API Print
Renders the print as HTML.
##### Request
```
GET /prints/3f7d252e-5e4f-4232-ac48-e67b08ffffc0
```
*Headers*
```
Accept: */*
```
##### Response
```
HTTP 200
```
*Headers*
```
content-type: text/html
```
*Body*
```
Deskriders :: API Print
Heading
Layout footer
```
*Sample Call*
```
curl -X 'GET' -H 'Accept: */*' 'http://localhost:8080/prints/3f7d252e-5e4f-4232-ac48-e67b08ffffc0'
```
### Development
```
git clone ...
```
To run application
```
./gradlew run
```
To run tests
```
./gradlew test
```