I have a python script that is supposed to upload a file to a php script.
Python
import requests
file={'file':('text.txt','hello')}
url='mywebsite.org/test.php
response = requests.post(url, files=file)
print(response.text)
PHP
<?php
var_dump($_FILES);
var_dump($_POST);
?>
This is the response that I am getting to the python script:
array(0) {
}
array(0) {
}
However, when I try posting to http://httpbin.org/post,
I get
...
"files": {
"file": "hello"
},
...
Which seems to indicate that there is something wrong with my server. What might be the problem?