How do I deliver python requests post --data-raw?

Asked 2 years ago, Updated 2 years ago, 103 views

curl --location --request POST 'https://test.com' \
--header 'Content-Type: application/json' \
--data-raw '{
    "encrypted":"U2FsdGVkX19ETWIFRzm0a/TA8s="
}'

Linux delivers it like this When I turned it over to Python, I turned it over to requests.post (url, json=data_raw, heads=header) and it didn't work. Is there any other way?

python python3 python3.6

2022-09-20 19:00

1 Answers

data = { "encrypted": "U2Fsd..." }

r = requests.post(url, json=data)

You can do it like this.


2022-09-20 19:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.