From bd61f48fe33e3366d85a0305882ccca9c77e2a07 Mon Sep 17 00:00:00 2001 From: Jonathan Toledo Date: Sat, 2 May 2020 16:52:51 +0000 Subject: [PATCH 1/2] Spanish Translate --- .../resets/01-what-is-a-request/app.py | 6 + .breathecode/resets/02-random-status/app.py | 3 + .breathecode/resets/03-response-body/app.py | 3 + .../resets/04-response-body-json/app.py | 4 + .breathecode/resets/05-project-name/app.py | 3 + .breathecode/resets/06-project-list/app.py | 3 + .../resets/07-project-list-image/app.py | 3 + .../resets/08-blog-post-author/app.py | 3 + .../resets/09-array-of-blog-titles/app.py | 5 + .breathecode/resets/10-get_post_tags/app.py | 8 + .../resets/11-get_attachment_by_id/app.py | 7 + .breathecode/resets/12-post-request/app.py | 3 + .../resets/13-post-request-body/app.py | 4 + bc.json | 143 +++++++++++++++++- exercises/01-hello-world/README.es.md | 13 ++ exercises/01-what-is-a-request/README.es.md | 20 +++ exercises/02-random-status/README.es.md | 14 ++ exercises/03-response-body/README.es.md | 14 ++ exercises/04-response-body-json/README.es.md | 36 +++++ exercises/05-project-name/README.es.md | 36 +++++ exercises/06-project-list/README.es.md | 40 +++++ exercises/07-project-list-image/README.es.md | 20 +++ exercises/08-blog-post-author/README.es.md | 20 +++ .../09-array-of-blog-titles/README.es.md | 13 ++ exercises/10-get_post_tags/README.es.md | 14 ++ .../11-get_attachment_by_id/README.es.md | 13 ++ exercises/11-get_attachment_by_id/README.md | 4 +- exercises/12-post-request/README.es.md | 25 +++ exercises/13-post-request-body/README.es.md | 24 +++ 29 files changed, 501 insertions(+), 3 deletions(-) create mode 100644 .breathecode/resets/01-what-is-a-request/app.py create mode 100644 .breathecode/resets/02-random-status/app.py create mode 100644 .breathecode/resets/03-response-body/app.py create mode 100644 .breathecode/resets/04-response-body-json/app.py create mode 100644 .breathecode/resets/05-project-name/app.py create mode 100644 .breathecode/resets/06-project-list/app.py create mode 100644 .breathecode/resets/07-project-list-image/app.py create mode 100644 .breathecode/resets/08-blog-post-author/app.py create mode 100644 .breathecode/resets/09-array-of-blog-titles/app.py create mode 100644 .breathecode/resets/10-get_post_tags/app.py create mode 100644 .breathecode/resets/11-get_attachment_by_id/app.py create mode 100644 .breathecode/resets/12-post-request/app.py create mode 100644 .breathecode/resets/13-post-request-body/app.py create mode 100644 exercises/01-hello-world/README.es.md create mode 100644 exercises/01-what-is-a-request/README.es.md create mode 100644 exercises/02-random-status/README.es.md create mode 100644 exercises/03-response-body/README.es.md create mode 100644 exercises/04-response-body-json/README.es.md create mode 100644 exercises/05-project-name/README.es.md create mode 100644 exercises/06-project-list/README.es.md create mode 100644 exercises/07-project-list-image/README.es.md create mode 100644 exercises/08-blog-post-author/README.es.md create mode 100644 exercises/09-array-of-blog-titles/README.es.md create mode 100644 exercises/10-get_post_tags/README.es.md create mode 100644 exercises/11-get_attachment_by_id/README.es.md create mode 100644 exercises/12-post-request/README.es.md create mode 100644 exercises/13-post-request-body/README.es.md diff --git a/.breathecode/resets/01-what-is-a-request/app.py b/.breathecode/resets/01-what-is-a-request/app.py new file mode 100644 index 0000000..de2b192 --- /dev/null +++ b/.breathecode/resets/01-what-is-a-request/app.py @@ -0,0 +1,6 @@ +import requests + +url = "https://assets.breatheco.de/apis/fake/sample/404-example.php" +response = requests.get(url) + +print("The response status is: "+str(response.status_code)) \ No newline at end of file diff --git a/.breathecode/resets/02-random-status/app.py b/.breathecode/resets/02-random-status/app.py new file mode 100644 index 0000000..d9ef815 --- /dev/null +++ b/.breathecode/resets/02-random-status/app.py @@ -0,0 +1,3 @@ +import requests + +response = requests.get("https://assets.breatheco.de/apis/fake/sample/random-status.php") diff --git a/.breathecode/resets/03-response-body/app.py b/.breathecode/resets/03-response-body/app.py new file mode 100644 index 0000000..37cdac0 --- /dev/null +++ b/.breathecode/resets/03-response-body/app.py @@ -0,0 +1,3 @@ +import requests + +url = "https://assets.breatheco.de/apis/fake/sample/random-status.php" \ No newline at end of file diff --git a/.breathecode/resets/04-response-body-json/app.py b/.breathecode/resets/04-response-body-json/app.py new file mode 100644 index 0000000..11ecbd8 --- /dev/null +++ b/.breathecode/resets/04-response-body-json/app.py @@ -0,0 +1,4 @@ +import requests + +response = requests.get("https://assets.breatheco.de/apis/fake/sample/time.php") +print(response.text) \ No newline at end of file diff --git a/.breathecode/resets/05-project-name/app.py b/.breathecode/resets/05-project-name/app.py new file mode 100644 index 0000000..a471294 --- /dev/null +++ b/.breathecode/resets/05-project-name/app.py @@ -0,0 +1,3 @@ +import requests + +# your code here \ No newline at end of file diff --git a/.breathecode/resets/06-project-list/app.py b/.breathecode/resets/06-project-list/app.py new file mode 100644 index 0000000..a471294 --- /dev/null +++ b/.breathecode/resets/06-project-list/app.py @@ -0,0 +1,3 @@ +import requests + +# your code here \ No newline at end of file diff --git a/.breathecode/resets/07-project-list-image/app.py b/.breathecode/resets/07-project-list-image/app.py new file mode 100644 index 0000000..a471294 --- /dev/null +++ b/.breathecode/resets/07-project-list-image/app.py @@ -0,0 +1,3 @@ +import requests + +# your code here \ No newline at end of file diff --git a/.breathecode/resets/08-blog-post-author/app.py b/.breathecode/resets/08-blog-post-author/app.py new file mode 100644 index 0000000..a471294 --- /dev/null +++ b/.breathecode/resets/08-blog-post-author/app.py @@ -0,0 +1,3 @@ +import requests + +# your code here \ No newline at end of file diff --git a/.breathecode/resets/09-array-of-blog-titles/app.py b/.breathecode/resets/09-array-of-blog-titles/app.py new file mode 100644 index 0000000..ffedd3e --- /dev/null +++ b/.breathecode/resets/09-array-of-blog-titles/app.py @@ -0,0 +1,5 @@ +import requests + +def get_titles(): + # your code here + return None \ No newline at end of file diff --git a/.breathecode/resets/10-get_post_tags/app.py b/.breathecode/resets/10-get_post_tags/app.py new file mode 100644 index 0000000..0889c24 --- /dev/null +++ b/.breathecode/resets/10-get_post_tags/app.py @@ -0,0 +1,8 @@ +import requests + +def get_post_tags(post_id): + # your code here + return None + + +print(get_post_tags(146)) \ No newline at end of file diff --git a/.breathecode/resets/11-get_attachment_by_id/app.py b/.breathecode/resets/11-get_attachment_by_id/app.py new file mode 100644 index 0000000..26274ff --- /dev/null +++ b/.breathecode/resets/11-get_attachment_by_id/app.py @@ -0,0 +1,7 @@ +import requests + +def get_attachment_by_id(attachment_id): + # your code here + return None + +print(get_attachment_by_id(137)) \ No newline at end of file diff --git a/.breathecode/resets/12-post-request/app.py b/.breathecode/resets/12-post-request/app.py new file mode 100644 index 0000000..a471294 --- /dev/null +++ b/.breathecode/resets/12-post-request/app.py @@ -0,0 +1,3 @@ +import requests + +# your code here \ No newline at end of file diff --git a/.breathecode/resets/13-post-request-body/app.py b/.breathecode/resets/13-post-request-body/app.py new file mode 100644 index 0000000..0edc6f1 --- /dev/null +++ b/.breathecode/resets/13-post-request-body/app.py @@ -0,0 +1,4 @@ +import requests + +resp = requests.post("https://assets.breatheco.de/apis/fake/sample/save-project-json.php") +print(resp.text) \ No newline at end of file diff --git a/bc.json b/bc.json index 744c96f..1c71e5e 100644 --- a/bc.json +++ b/bc.json @@ -1,3 +1,144 @@ { - "language": "python3" + "port": 3000, + "address": "localhost", + "editor": "gitpod", + "outputPath": "./.breathecode/dist", + "publicPath": "/preview", + "grading": "isolated", + "ignoreRegex": null, + "webpack_template": null, + "disable_grading": false, + "onCompilerSuccess": null, + "language": "python3", + "compiler": "python3", + "tester": "pytest", + "actions": [ + "run", + "test", + "reset" + ], + "session": 3445355432462036000, + "exercisesPath": "./exercises", + "exercises": [ + { + "slug": "01-hello-world", + "title": "01-hello-world", + "path": "exercises/01-hello-world", + "translations": [ + "es", + "us" + ] + }, + { + "slug": "01-what-is-a-request", + "title": "01-what-is-a-request", + "path": "exercises/01-what-is-a-request", + "translations": [ + "es", + "us" + ] + }, + { + "slug": "02-random-status", + "title": "02-random-status", + "path": "exercises/02-random-status", + "translations": [ + "es", + "us" + ] + }, + { + "slug": "03-response-body", + "title": "03-response-body", + "path": "exercises/03-response-body", + "translations": [ + "es", + "us" + ] + }, + { + "slug": "04-response-body-json", + "title": "04-response-body-json", + "path": "exercises/04-response-body-json", + "translations": [ + "es", + "us" + ] + }, + { + "slug": "05-project-name", + "title": "05-project-name", + "path": "exercises/05-project-name", + "translations": [ + "es", + "us" + ] + }, + { + "slug": "06-project-list", + "title": "06-project-list", + "path": "exercises/06-project-list", + "translations": [ + "es", + "us" + ] + }, + { + "slug": "07-project-list-image", + "title": "07-project-list-image", + "path": "exercises/07-project-list-image", + "translations": [ + "es", + "us" + ] + }, + { + "slug": "08-blog-post-author", + "title": "08-blog-post-author", + "path": "exercises/08-blog-post-author", + "translations": [ + "us" + ] + }, + { + "slug": "09-array-of-blog-titles", + "title": "09-array-of-blog-titles", + "path": "exercises/09-array-of-blog-titles", + "translations": [ + "us" + ] + }, + { + "slug": "10-get_post_tags", + "title": "10-get_post_tags", + "path": "exercises/10-get_post_tags", + "translations": [ + "us" + ] + }, + { + "slug": "11-get_attachment_by_id", + "title": "11-get_attachment_by_id", + "path": "exercises/11-get_attachment_by_id", + "translations": [ + "us" + ] + }, + { + "slug": "12-post-request", + "title": "12-post-request", + "path": "exercises/12-post-request", + "translations": [ + "us" + ] + }, + { + "slug": "13-post-request-body", + "title": "13-post-request-body", + "path": "exercises/13-post-request-body", + "translations": [ + "us" + ] + } + ] } \ No newline at end of file diff --git a/exercises/01-hello-world/README.es.md b/exercises/01-hello-world/README.es.md new file mode 100644 index 0000000..30f83f8 --- /dev/null +++ b/exercises/01-hello-world/README.es.md @@ -0,0 +1,13 @@ +# Python API Requests + +Python Requests es el paquete más popular para consumir API y hacer solicitudes HTTP. + +Aquí aprenderás: + +1. Cómo hacer solicitudes GET. +2. Cómo obtener propiedades de una data e información. +3. Cómo configurar request headers. +4. Cómo configurar request content-type. +5. Cómo hacer solicitudes POST. + +Haga click en el botón `next →` en la esquina superior derecha para continuar. \ No newline at end of file diff --git a/exercises/01-what-is-a-request/README.es.md b/exercises/01-what-is-a-request/README.es.md new file mode 100644 index 0000000..408b1d2 --- /dev/null +++ b/exercises/01-what-is-a-request/README.es.md @@ -0,0 +1,20 @@ +# 02 Creando una solicitud (request) + +Python tiene un [paquete de solicitud (requests package)](https://requests.readthedocs.io/en/master/) eso permite a los desarrolladores crear solicitudes HTTP con bastante facilidad. + +Así es como en Python hacemos una solicitud HTTP GET: + +```python +response = requests.get('') +print(response.status_code) +``` + +# 📝 Instrucciones + +Cambie la variable URL para que solicite: + +```bash +https://assets.breatheco.de/apis/fake/sample/hello.php +``` + +Nota: La consola debe imprimir un código de estado 200. \ No newline at end of file diff --git a/exercises/02-random-status/README.es.md b/exercises/02-random-status/README.es.md new file mode 100644 index 0000000..a1a3d54 --- /dev/null +++ b/exercises/02-random-status/README.es.md @@ -0,0 +1,14 @@ +# `02` Manejar el Status de Respuesta + +La siguiente solicitud GET siempre devuelve un código de status diferente, nunca se sabe qué respuesta está recibiendo del servidor. + +## 📝Instrucciones + +Crea una condición para imprimir en la consola los siguientes mensajes según el status de respuesta: + +| Status | Message | +| ----- | ----- | +| 404 | The URL you asked is not found | +| 503 | Unavailable right now | +| 200 | Everything went perfect | +| 400 | Something is wrong on the request params | \ No newline at end of file diff --git a/exercises/03-response-body/README.es.md b/exercises/03-response-body/README.es.md new file mode 100644 index 0000000..8e93d07 --- /dev/null +++ b/exercises/03-response-body/README.es.md @@ -0,0 +1,14 @@ +# `03` Respuesta en Body + +Haga clic en este enlace para ver la respuesta que esta solicitud GET está dando en el body: +[https://assets.breatheco.de/apis/fake/sample/random-status.php](https://assets.breatheco.de/apis/fake/sample/random-status.php) + +Ahora, si deseas obtener ese body como respuesta (texto), todo lo que tiene que hacer es: +```py +# plain text +print(response.text) +``` + +# 📝 Instrucciones + +Imprime en la consola la the responde body solo para solicitudes 200, para el resto imprima "Something went wrong". \ No newline at end of file diff --git a/exercises/04-response-body-json/README.es.md b/exercises/04-response-body-json/README.es.md new file mode 100644 index 0000000..5b00639 --- /dev/null +++ b/exercises/04-response-body-json/README.es.md @@ -0,0 +1,36 @@ +# `04` Respuesta JSON + +Pero tener una respuesta basada en texto no es muy útil, es por eso que las API normalmente responden en formato CSV, JSON, YAML o XML. + +# 📝 Instrucciones + +El siguiente endpoint devuelve la hora actual en un formato JSON cada vez que se solicita utilizando el método GET. + +| | | +| --- | --- | +| method | GET | +| endpoint | https://assets.breatheco.de/apis/fake/sample/time.php | +| content-type | application/json | + +Response body: + +```python +{ + "hours": "07", + "minutes": "29", + "seconds": "35" +} +``` + +Haga una solicitud GET a ese endpoint e imprima la hora en la consola con este formato: + +```bash +Current time: 17 hrs 06 min and 23 sec +``` + +## 💡Pista + +1. Usa el [metodo .json()](https://www.w3schools.com/python/ref_requests_response.asp) para obtener el response body como un diccionario y almacenarlo en una variable +2. Obtenga las propiedades `horas`,` minutos` y `segundos` del diccionario +3. Concatenar todo de esta manera: `Hora actual: 17 h 06 min y 23 seg` + diff --git a/exercises/05-project-name/README.es.md b/exercises/05-project-name/README.es.md new file mode 100644 index 0000000..65ddfed --- /dev/null +++ b/exercises/05-project-name/README.es.md @@ -0,0 +1,36 @@ +# `05` Nombre de Proyecto + +El siguiente endpoint es ideal para recuperar proyectos de estudiantes: + +GET [https://assets.breatheco.de/apis/fake/sample/project1.php](https://assets.breatheco.de/apis/fake/sample/project1.php) + +```json +{ + "name": "Coursera eLearning", + "thumb": "https://unsplash.it/450/320?image=178", + "description": "The coolest elarning site on the planet", + "images": [ + "https://unsplash.it/450/320?image=178", + "https://unsplash.it/450/320?image=179", + "https://unsplash.it/450/320?image=180", + "https://unsplash.it/450/320?image=181" + ] +} +``` + +# 📝 Instrucciones + +Llama al endpoint e imprime el nombre del proyecto en el terminal (solo el nombre del proyecto) + +Example output: +```bash +Coursera eLearning +``` + +## 💡Pista + +1. Ejercicio similar al anterior. +2. Haz una solicitud GET al endpoint. +3. Usa el [metodo .json()](https://www.w3schools.com/python/ref_requests_response.asp) para obtener el response body como un diccionario (igual que lo hizo en el último ejercicio). +4. Imprime el nombre del proyecto, puedes acceder al nombre de la propiedad en el diccionario de respuestas. + diff --git a/exercises/06-project-list/README.es.md b/exercises/06-project-list/README.es.md new file mode 100644 index 0000000..0850906 --- /dev/null +++ b/exercises/06-project-list/README.es.md @@ -0,0 +1,40 @@ +# `06` Lista de Proyectos + +El siguiente endpoint devuelve una respuesta con formato JSON con varios proyectos en una lista: + +GET: [https://assets.breatheco.de/apis/fake/sample/project_list.php](https://assets.breatheco.de/apis/fake/sample/project_list.php) + +Cada uno de los proyectos tiene el siguiente formato (ejemplo): +```json +{ + "name": "Coursera eLearning", + "thumb": "https://unsplash.it/450/320?image=178", + "description": "The coolest elarning site on the planet", + "images": [ + "https://unsplash.it/450/320?image=178", + "https://unsplash.it/450/320?image=179", + "https://unsplash.it/450/320?image=180", + "https://unsplash.it/450/320?image=181" + ] +} +``` + +# 📝 Instrucciones + +Llame al punto final e imprima el nombre del **SEGUNDO** proyecto en la lista: + +Ejemplo: +```bash +Coursera eLearning +``` + +## 💡Pista + +1. Abre el endpoint en tu navegador y analiza la respuesta que se encuentra en el body, necesitas saber qué esperar, cuál será la estructura de los datos (body response) que regresan del servidor. +2. En este caso, el body response comienza con un corchete `[`, es una lista, debe acceder al segundo proyecto utilizando posiciones numéricas. +2. Haga una solicitud GET al endpoint. +3. Usa el [metodo .json()](https://www.w3schools.com/python/ref_requests_response.asp)para obtener el body response como un diccionario. +4. Encuentra el segundo proyecto +5. Imprime el nombre del proyecto, puedes acceder a la propiedad nombre "name" del diccionario del proyecto. +6. No necesitas hacer un bucle (loop), solo accede al segundo elemento como una lista usando la posición + diff --git a/exercises/07-project-list-image/README.es.md b/exercises/07-project-list-image/README.es.md new file mode 100644 index 0000000..0c5c96b --- /dev/null +++ b/exercises/07-project-list-image/README.es.md @@ -0,0 +1,20 @@ +# `07` Lista de las Imagenes del Proyecto + +# 📝 Instrucciones + +Haz una solicitud GET a la misma URL que en el ejercicio anterior, imprime la `última` url image (imagen de la url) en el `último` proyecto. + +Ejemplo: +```bash +https://image.shutterstock.com/image-vector/trophy-cup-award-vector-icon-260nw-592525184.jpg +``` + +## 💡Pista + +1. Haz una solicitud GET al endpoint. +2. Usa el [metodo .json()](https://www.w3schools.com/python/ref_requests_response.asp) para obtener el response body como un diccionario. +3. Encuentra el último proyecto en la lista. +4. Encuentra la última imagen de ese proyecto. +5. Imprima la imagen de la URL en la consola. +6. No es necesario realizar un bucle (loop), solo use las posiciones numéricas (índice/index) para acceder a la información + diff --git a/exercises/08-blog-post-author/README.es.md b/exercises/08-blog-post-author/README.es.md new file mode 100644 index 0000000..ba99543 --- /dev/null +++ b/exercises/08-blog-post-author/README.es.md @@ -0,0 +1,20 @@ +# `08` Publicar autor de blog + +Tómate un momento para comprender el body response al hacer una solicitud GET a este endpoint: +[https://assets.breatheco.de/apis/fake/sample/weird_portfolio.php](https://assets.breatheco.de/apis/fake/sample/weird_portfolio.php) + +👉🏼 [Aquí hay una breve explicación en video.](https://www.youtube.com/watch?v=fwfBYVrvSk0) + +# 📝 Instrucciones + +Obtén el nombre del autor de la primera publicación. + +## 💡Pista + +1. Haz una solicitud GET al endpoint. +2. Usa el [metodo .json()](https://www.w3schools.com/python/ref_requests_response.asp) para obtener el response body como un diccionario. +3. Encuentra la primera publicación +4. Obtén el autor del diccionario +5. Escribe el nombre del autor +6. No necesitas hacer un bucle (loop), solo usa las posiciones (índice/index) + diff --git a/exercises/09-array-of-blog-titles/README.es.md b/exercises/09-array-of-blog-titles/README.es.md new file mode 100644 index 0000000..805a063 --- /dev/null +++ b/exercises/09-array-of-blog-titles/README.es.md @@ -0,0 +1,13 @@ +# `09` Arreglo con titulos de publicaciones + +# 📝 Instrucciones + +Usando el mismo endpoint del ejercicio anterior, crea una función `get_titles` que retorne los titulos de todos los post (publicaciones) encontradas en el response body. + +## 💡Pista + +1. Crea una función `get_titles`. +2. realiza un bucle (Loop). +3. Agregue cada título de publicación al nuevo arreglo. +4. Retorna el arreglo + diff --git a/exercises/10-get_post_tags/README.es.md b/exercises/10-get_post_tags/README.es.md new file mode 100644 index 0000000..3293758 --- /dev/null +++ b/exercises/10-get_post_tags/README.es.md @@ -0,0 +1,14 @@ +# `10` Obtener etiqueta de publicación + +# 📝 Instrucciones + +Usando el mismo endpoint del ejercicio anterior, crea una función `get_post_tags` que retorne el arreglo de etiquetas (tags) de un `post id` dado. + +## 💡Pista + +1. Crea la función `get_post_tags`. +2. Obtén todas las publicaciones (post) haciendo la solicitud GET al endpoint. +3. Declare la variable para almacenar el body serializado +4. Usando el parámetro `post_id`, recorre con un loop todas las publicaciones y compara sus ID para ver si coinciden con el` post_id`. +3. Cuando encuentres la publicación que deseas, devuelve una lista de etiquetas (tags) + diff --git a/exercises/11-get_attachment_by_id/README.es.md b/exercises/11-get_attachment_by_id/README.es.md new file mode 100644 index 0000000..d7b82c2 --- /dev/null +++ b/exercises/11-get_attachment_by_id/README.es.md @@ -0,0 +1,13 @@ +# `11` Obtener un archivo adjunto (attachment) por id + +# 📝 Instrucciones + +Usando el mismo endpoint del ejercicio anterior, crea una función `get_attachment_by_id` que retornes el titulo de los adjuntos que correspondan con el id dado. + +## 💡Pista + +1. Crea la función `get_attachment_by_id` que reciba el `attachment_id` como un parametro. +2. Recorre (Loop) todos los posts. +3. Recorre (Loop) todos los attachments (adjuntos) de cada post. +4. Si el archivo adjunto (attachment) tiene el `attach_id` dado en el parámetro de la función, devuélvalo. + diff --git a/exercises/11-get_attachment_by_id/README.md b/exercises/11-get_attachment_by_id/README.md index faa37a2..5f3864e 100644 --- a/exercises/11-get_attachment_by_id/README.md +++ b/exercises/11-get_attachment_by_id/README.md @@ -1,4 +1,4 @@ -# `11` Get atthachment by id +# `11` Get attachment by id # 📝 Instructions @@ -9,5 +9,5 @@ Using the same endpoint from the previous exercise, create a function `get_attac 1. Create the function `get_attachment_by_id` that recives the `attachment_id` as a parameter. 2. Loop all the posts. 3. Loop all the attachments for each post. -4. If the attachchment has the given `attachment_id` in the function paramter, return it. +4. If the attachment has the given `attachment_id` in the function parameter, return it. diff --git a/exercises/12-post-request/README.es.md b/exercises/12-post-request/README.es.md new file mode 100644 index 0000000..fc7a1a7 --- /dev/null +++ b/exercises/12-post-request/README.es.md @@ -0,0 +1,25 @@ +# `12` Solicitud POST + +Las solicitudes POST están destinadas a la creación, por ejemplo, si tu negocio es un e-comerce de camisas , es probable que desee tener una forma de agregar nuevos clientes. + +Una solicitud de post generalmente tiene: + +| | | +| ---- | ---- | +| Method | POST | +| Content-Type | application/json | +| Body (payload) | JSON string | + +# 📝 Instrucciones + +Envía una solitud POST al siguiente URL: + +POST: https://assets.breatheco.de/apis/fake/sample/post.php + +E imprime la respuesta (text response) en la consolae + +## 💡Pista + +Usa el paquete de solicitudes del metodo post: +https://www.w3schools.com/python/ref_requests_post.asp + diff --git a/exercises/13-post-request-body/README.es.md b/exercises/13-post-request-body/README.es.md new file mode 100644 index 0000000..bc8505b --- /dev/null +++ b/exercises/13-post-request-body/README.es.md @@ -0,0 +1,24 @@ +# `13` POST request body + +# 📝 Instrucciones + +Envía una solitud POST al siguiente URL: +https://assets.breatheco.de/apis/fake/sample/save-project-json.php + +Con `Content-Type: application/json` + +Con el siguiente request body como texto JSON: + +```json +{ + "id":2323, + "title": "Very big project" +} + +``` + +## 💡Pista + +Usa el paquete de solicitudes del metodo post: +https://www.w3schools.com/python/ref_requests_post.asp + From 53a680db4c7e4dd18c8fa36d8c83846ec3b94536 Mon Sep 17 00:00:00 2001 From: Jonathan Toledo Date: Sat, 2 May 2020 16:57:26 +0000 Subject: [PATCH 2/2] update repository --- bc.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bc.json b/bc.json index 1c71e5e..6f261b6 100644 --- a/bc.json +++ b/bc.json @@ -97,6 +97,7 @@ "title": "08-blog-post-author", "path": "exercises/08-blog-post-author", "translations": [ + "es", "us" ] }, @@ -105,6 +106,7 @@ "title": "09-array-of-blog-titles", "path": "exercises/09-array-of-blog-titles", "translations": [ + "es", "us" ] }, @@ -113,6 +115,7 @@ "title": "10-get_post_tags", "path": "exercises/10-get_post_tags", "translations": [ + "es", "us" ] }, @@ -121,6 +124,7 @@ "title": "11-get_attachment_by_id", "path": "exercises/11-get_attachment_by_id", "translations": [ + "es", "us" ] }, @@ -129,6 +133,7 @@ "title": "12-post-request", "path": "exercises/12-post-request", "translations": [ + "es", "us" ] }, @@ -137,6 +142,7 @@ "title": "13-post-request-body", "path": "exercises/13-post-request-body", "translations": [ + "es", "us" ] }