1

I am trying to replicate the below curl command in python using the requests module. The curl command is as follows:

curl -v -k -H "apikey:INTERNAL_TEST" http://api1/publicapi/macro/<sha256> -X POST

I am able to replicate the whole curl command except the letter '-X' before POST.

Please inform me in case more information is required. Thank you in advance.

1 Answer 1

2

The -X flag in curl is for specifying the HTTP method for your request.

You can used requests.post to make HTTP POST request.

url = 'http://api1/publicapi/macro/<sha256>'
headers = {'apikey': 'INTERNAL_TEST'}

response = requests.post(url, headers=headers)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.