Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Ejercicio-Teoria-API-Rest/orderRequests.http
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
35 lines (29 sloc)
946 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ejercicio APIs Rest | |
# Autores: Agustín Borrego, Inma Hernández, David Ruiz | |
# Fecha creación: noviembre 2020 | |
@base= http://localhost:8080/api/v1 | |
### Obtener todos los pedidos del producto 2 | |
GET {{base}}/products/2/orders | |
### Obtener todos los pedidos del usuario 2 | |
GET {{base}}/users/2/orders | |
### Obtener todos los pedidos del usuario 3 ordenado crecientemente por la fecha de compra | |
GET {{base}}/users/3/orders?_sort=amount&_order=asc | |
### Insertar un nuevo pedido con los valores | |
### (userId=3, productId=2, purchaseDate=2019-11-26 y amount=5) | |
POST {{base}}/orders | |
Content-Type: application/json | |
{ | |
"amount": 5, | |
"productId": 2, | |
"purchaseDate": "2019-11-26", | |
"userId": 3 | |
} | |
### Actualizar el pedido 3 con los valores {userId=4, productId=2, purchaseDate=2018-05-18, amount=20} | |
PUT {{base}}/orders/3 | |
Content-Type: application/json | |
{ | |
"amount": 23, | |
"productId": 2, | |
"purchaseDate": "2018-05-18", | |
"userId": 4 | |
} |