Skip to main content

All Questions

0 votes
1 answer
49 views

API working when using curl but returns 400 error when using requests.post

I'm trying to use an API via Docker to predict captions for an image with the MAX-Image-Caption-Generator-Model. When using the curl command curl -F "[email protected]" -X POST http://...
ChessHanks's user avatar
0 votes
0 answers
38 views

in python how to correct post request from curl

I would like to make a post request from postman on python. As an example they give a curl. Heretheurl replaces the actual url. curl --location 'https://heretheurl?jwt=token' --header 'Authorization: ...
Anna's user avatar
  • 119
1 vote
2 answers
366 views

Python file upload post request not pushed as expected

I am trying to upload an image attachment through an API, the something can be achieved through a web interface. Both make requests to the same url, same headers, everything. But the issue is that the ...
spospider's user avatar
0 votes
1 answer
47 views

Python Post Request works, but the same PHP (CURL) does not work

I was trying to write the same post request via php as i did in python. In python it works well, while in php it does not even reach the server at all. This is php 7.4. Also I can access the server ...
Brana's user avatar
  • 1,239
0 votes
1 answer
983 views

Python Requests hanging when cURL is working just fine

I'm experiencing a strange issue where Python post Requests are hanging, while cURL post requests are working just fine. I'm making a request to the NIH Reporter API. Here's the Python code that keeps ...
Rapid Readers's user avatar
0 votes
1 answer
827 views

Receive Indeed API Access Token

I am trying to get the Indeed vacancies of my company via API with Python. I am following https://developer.indeed.com/docs/authorization/3-legged-oauth and https://mathiashaentjens.medium.com/how-do-...
msklc's user avatar
  • 604
0 votes
2 answers
2k views

Uploading to anonfiles API with curl in python

I want to upload to anonfiles using the requests module. Code runs but the files don't appear on the website. Here's my code so far: import requests files = { 'file': ('file.txt', open('file.txt',...
0xStefanos's user avatar
1 vote
2 answers
323 views

Can't upload file from Python requests, while CURL is work fine

I am trying to upload file to some api with this function: def upload_avatar(cred, file): headers = {'accept': '*/*', 'Content-Type': 'multipart/form-data', 'Authorization': f'Bearer {cred}'} ...
kilcat's user avatar
  • 21
0 votes
1 answer
124 views

Translation needed for www.mirrored.to api php code to python

<?php //***EDIT THE FOLLOWING ***// $api_key = "abcdefabcdefabcdefabcdef"; //Your API Key //***EDIT END ***// $url = "https://www.mirrored.to/api/v1/get_account_info"; $post =...
Murphy Kwok's user avatar
0 votes
1 answer
139 views

How to send files via post request in python similar to curl? (W3C validator)

I am trying to send a local html file from my computer to the https://validator.nu/ from W3C to validate it. I found this curl command which worked perfectly fine in terminal: curl -H "Content-...
John's user avatar
  • 7
1 vote
3 answers
309 views

Why does Python: requests.post result in 406 Error

I'm probably too old for this, but I'm trying to learn Python. I am a long time tyro at bash. As an exercise I am attempting to rewrite a bash script in Python. One of the things the script does is ...
Buadhai's user avatar
  • 236
-1 votes
1 answer
685 views

How to get a specific parameter the HTTP Response (after a curl POST) in Python

I wanted to know how could I send a curl HTTP Post and store the value of a specific parameter of its curl HTTP response using Python. So, I first need to execute this HTTP POST in Python which I ...
Mateo Criado's user avatar
0 votes
1 answer
1k views

cURL POST request not working as python requests equivalent

I have a curl POST request that returns a CSV in the terminal as expected. The following format is provided in the RJMetrcis documentation (see "Export figure data"). Here is the curl ...
iskandarblue's user avatar
  • 7,536
0 votes
1 answer
737 views

filter curl command by date using python

I am using python to pull log using the API curl command. curl -H "Authorization:Token xxxxxxxx-xxxx-xxxxx" -XGET https://my-api.holmsecurity.com/v2/net-scans I want to filter this curl output say '...
Ajay Gupta's user avatar
0 votes
1 answer
56 views

Multipart POST request in Python

I have the following curl command which works perfectly in Terminal curl --location --request POST 'https://online.tet_url' --form license='test_licence' --form product='pdfserver' --form readUSdates=...
Jeff Tehrani's user avatar

15 30 50 per page