Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Mar 16, 2024

import tls_client
client = tls_client.Session()
print(client.post('https://httpbin.org/post', json={'a':'b'}).json()
{'args': {}, 'data': '{"a": "b"}', 'files': {}, 'form': {}, 'headers': {'Accept': '/', 'Accept-Encoding': 'gzip, deflate, br', 'Content-Length': '10', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'tls-client/1.0.1', 'X-Amzn-Trace-Id': 'Root=1-65f57b99-62f659ac717afad079b6f9f6'}, 'json': {'a': 'b'}, 'origin': '24.6.214.76', 'url': 'https://httpbin.org/post'}
print(client.post('https://httpbin.org/post', data={'a':'b'}).json() # content-type show be application/x-www-form-urlencoded
{'args': {}, 'data': 'a=b', 'files': {}, 'form': {}, 'headers': {'Accept': '/', 'Accept-Encoding': 'gzip, deflate, br', 'Content-Length': '3', 'Content-Type': 'application/json', 'Host': 'httpbin.org', 'User-Agent': 'tls-client/1.0.1', 'X-Amzn-Trace-Id': 'Root=1-65f57ba4-5caf4a7701cfc5eb735aac2d'}, 'json': None, 'origin': '24.6.214.76', 'url': 'https://httpbin.org/post'}

@enodr
Copy link

enodr commented Jun 12, 2024

This PR fixes #122 #119 #117 #83 and probably more issues.

This is the correct fix for the decoding problem with binary content. Please can you merge in master ?

@Sirorezka
Copy link

Hi, sry, when this commit will be merged?)

@ghost ghost closed this by deleting the head repository Sep 12, 2024
3droj7 pushed a commit to 3droj7/python-tls-client-async that referenced this pull request May 11, 2025
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants