Skip to content

Commit 88eebf2

Browse files
author
brentru
committed
fix RuntimeError: Cannot access content after getting text or json
1 parent c070f6e commit 88eebf2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

examples/requests_advanced.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
# Initialize a requests object with a socket and esp32spi interface
4141
socket.set_interface(esp)
42-
requests.set_socket(socket)
42+
requests.set_socket(socket, esp)
4343

4444
JSON_GET_URL = "http://httpbin.org/get"
4545

@@ -59,8 +59,5 @@
5959
print("Response HTTP Status Code: ", response.status_code)
6060
print("-" * 60)
6161

62-
# Read Response, as raw bytes instead of pretty text
63-
print("Raw Response: ", response.content)
64-
6562
# Close, delete and collect the response data
6663
response.close()

0 commit comments

Comments
 (0)