scrapy - How do I write a form equivalent to this curl to send requests to my scrapyd instance? -


curl http://localhost:6800/addversion.json -f project=firstproject -f version=r2 -f egg=@/tmp/scrapydeploy-ffa46x/project-1.0-py2.7.egg 

response:

{"status": "ok", "project": "firstproject", "version": "r2", "spiders": 2} 

i have tried

<form action="http://localhost:6800/addversion.json" method="post">     <input type="text" name="project" placeholder="project"></input>     <input type="text" name="version" placeholder="version"></input>     <input type="file"name="egg" placeholder="version"></input>     <input type="submit"</input>   </form> 

with same strings first 2 parameters in curl, , same file selected third paramter.

reponse:

{"status": "error", "message": "valueerror: unknown or corrupt egg"} 

how make submitting form behave same curl?


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -