Skip to content
Permalink
da2123d1cc
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
35 lines (29 sloc) 946 Bytes
# 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
}