I have a curl statement as follows taken from this link:
curl -v -include --form input=@./thefile.pdf localhost:8080/processFulltextDocument
I am trying to use Requests to replicate the above statement in Python and so am using the following code
import requests
Data = {'input': './samp.pdf'}
url='http://127.0.0.1:8080/processFulltextDocument'
r = requests.post(url,data=Data)
print r.text
However, I receive a 415 error. What am I doing wrong?
EDIT The headers of the curl statement are as follows:
curl -v -include --form input=@./samp.pdf 127.0.0.1:8080/processFulltextDocument
* Couldn't find host 127.0.0.1 in the .netrc file; using defaults
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> POST /processFulltextDocument HTTP/1.1
> User-Agent: curl/7.35.0
> Host: 127.0.0.1:8080
> Accept: */*
> Content-Length: 549488
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------df1c59f42e57cbf4
>
< HTTP/1.1 100 Continue
HTTP/1.1 100 Continue