meta data de esta página
Diferencias
Muestra las diferencias entre dos versiones de la página.
Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
codigo_python_dominicana [2023/12/13 20:57] 179.63.109.4 |
codigo_python_dominicana [2024/03/31 21:51] (actual) 47.128.60.184 se ha restaurado la vieja versión (2024/03/25 02:29) |
||
---|---|---|---|
Línea 1: | Línea 1: | ||
====== CODIGO PYTHON REST API ====== | ====== CODIGO PYTHON REST API ====== | ||
- | |||
- | [[start|{{ : | ||
<code python Autenticacion> | <code python Autenticacion> | ||
Línea 9: | Línea 7: | ||
respjson={" | respjson={" | ||
- | j={" | + | j={" |
response = requests.post(" | response = requests.post(" | ||
Línea 33: | Línea 31: | ||
print(" | print(" | ||
print(response.json()) # | print(response.json()) # | ||
- | print(" | ||
- | respjson=json.dumps(response.json()) | ||
- | print(respjson.capitalize()) # | ||
- | </ | ||
- | |||
- | <code python Enviar> | ||
- | import requests | ||
- | import json | ||
- | |||
- | respjson={" | ||
- | |||
- | #Creamos una factura json | ||
- | |||
- | j={ | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | } | ||
- | ], | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | ], | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | |||
- | }, | ||
- | " | ||
- | }, | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | ], | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | |||
- | |||
- | # | ||
- | response = requests.post(" | ||
- | |||
- | |||
- | |||
- | print(" | ||
- | print(response.json()) #Imprimimos el resultado en json | ||
print(" | print(" | ||
respjson=json.dumps(response.json()) | respjson=json.dumps(response.json()) |