Skip to content

Instantly share code, notes, and snippets.

@shc261392
shc261392 / binary_form_data_issue_showcase.py
Created December 17, 2022 08:36
A script to reproduce the issue that binary data is lost when using httpx client with authlib 1.2.0
from io import BytesIO
from authlib.integrations.requests_client import OAuth1Session
from authlib.integrations.httpx_client import OAuth1Client
CLIENT_ID = 'mockClientId'
CLIENT_SECRET = 'mockClientSecret'
ENDPOINT = 'http://localhost:8000'
@shc261392
shc261392 / post_debug_server.py
Created December 17, 2022 08:26
A simple HTTP server for debugging POST request content-length header and actual content length.
#!/usr/bin/env python3
import http.server
import socketserver
PORT = 8000
class CustomHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def do_POST(self):