0

I have the following Curl request:

curl -v --location --request POST 'http://127.0.0.1:8080/abc' \--header 'Content-Type: application/json' \--data-raw '{data}'

I tried using pycurl and requests command. Also tried to put headers but it was of no use.

My tried code:

requests = "curl -v --location"

a = "http://127.0.0.1:8080/abc"

headers = {'Content-Type': 'application/json'}

r = requests.post(url=a, headers= headers , params=data)

1 Answer 1

2

Is this works? https://curl.trillworks.com/

import requests

headers = {
    'Content-Type': 'application/json',
}

data = '{data}'

response = requests.post('http://127.0.0.1:8080/abc',
                         headers=headers,
                         data=data)

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

@Ashwinikumarjha If this worded fine, please mark my answer as accepted. Thank you.

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.