I'm at a loss regarding the following:
import urequests as requests
import ujson
method = "get"
url = "https://api.example.com"
headers = {
"authorization": "Bearer" + token,
"accept": "application/json"
}
result = requests.request(method, url, headers)
result_obj = ujson.loads(result.json())
Looking at the request function within urequests.py, I believe I do have to pass a dictionary onto headers. However; the following is returned when I do so: TypeError: object with buffer protocol required
If I pass on the headers within the function call. I get a Bad Request error and no other way to read the response object to determine the exact cause.
I'm at a loss regarding the following:
Looking at the request function within urequests.py, I believe I do have to pass a dictionary onto headers. However; the following is returned when I do so:
TypeError: object with buffer protocol requiredIf I pass on the headers within the function call. I get a Bad Request error and no other way to read the response object to determine the exact cause.