Code | Explanation |
---|---|
with open("temp_schema.json", mode="rt", encoding="utf-8") as patched_schema: |
Opens the file in read mode with UTF-8 encoding |
schema_to_patch = patched_schema.read() |
Reads the contents of the file into a string |
schema_patcher_http_requestor.make_iglu_request(...) |
Calls the make_iglu_request function |
res = request_func(...) |
Makes an HTTP request using the requests library |
json=schema_to_patch |
Passes the contents of the file as a string to the json parameter |
Created
July 21, 2023 02:42
-
-
Save pkutaj/936814035f5a0db3df66ea9310b420a5 to your computer and use it in GitHub Desktop.
2023-07-21-How-to-Fix-422-Client-Error--Unprocessable-Entity-when-using-json-parameter-of-Request-Python-Module.md
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment