Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Go-mazon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Albrecht
Go-mazon
Commits
e10fb4b9
Commit
e10fb4b9
authored
1 year ago
by
albrecht
Browse files
Options
Downloads
Patches
Plain Diff
Productfunktionen in readme eingefügt
parent
e2e62e86
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+42
-3
42 additions, 3 deletions
README.md
with
42 additions
and
3 deletions
README.md
+
42
−
3
View file @
e10fb4b9
...
@@ -20,6 +20,8 @@ docker compose down
...
@@ -20,6 +20,8 @@ docker compose down
## All API Functions
## All API Functions
In this section all API-Functions will be presented with an example call!
In this section all API-Functions will be presented with an example call!
### GET JWT-Token
### GET JWT-Token
Use the Result-Token for all marked API-Functions!
Use the Result-Token for all marked API-Functions!
```
```
...
@@ -33,9 +35,46 @@ curl --location --request GET 'localhost:8080/createJWT' \
...
@@ -33,9 +35,46 @@ curl --location --request GET 'localhost:8080/createJWT' \
### CREATE PRODUCT (Admin only)
### CREATE PRODUCT (Admin only)
```
```
curl -H "Content-Type: application/json" -d '{"description":"test","totalrating":4.0,"price":2.38}' localhost:8080/product/new
curl --location 'localhost:8080/products' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer INSERT_TOKEN_HERE' \
--data '{
"name": "WirePods",
"description": "Kabellose Kopfhörer",
"price": 130.20
}'
```
### UPDATE PRODUCT (Admin only)
```
curl --location --request PUT 'localhost:8080/products/1' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer INSERT_TOKEN_HERE' \
--data '{
"name": "new Name",
"description": "new Description",
"price": 100.00
}'
```
### DELETE PRODUCT (Admin only)
```
curl --location --request DELETE 'localhost:8080/products/1' \
--header 'Authorization: Bearer INSERT_TOKEN_HERE'
```
### GET ALL PRODUCTS
```
curl --location 'localhost:8080/products'
```
```
### GET SINGLE PRODUCT
```
curl --location 'localhost:8080/products/1'
```
Read Product
### Health Check
curl localhost:8080/products
Function tests if the service is running.
\ No newline at end of file
```
curl --location 'localhost:8080/health'
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment