Comments (2)
The errors comes with Python post :
r = requests.post(url, data=param, files={'file': open(img_path, 'rb')})
It works with cURL:
curl URL -F "file=@test/test_imgs/sushi.jpg" -F "model=default"
from waffle.
I verified. Indeed, with python-requests, there is no content-type header.
Cf http://docs.python-requests.org/en/master/user/quickstart/, section Post a multipart-encoded file.
To have the content type, it is optional with the following syntax :
url = 'http://httpbin.org/post'
files = {'file': ('report.xls', open('report.xls', 'rb'), 'application/vnd.ms-excel', {'Expires': '0'})}
r = requests.post(url, files=files)
So it might be good to have the server work without content type header.
from waffle.
Related Issues (17)
- buffer not in rockspec HOT 2
- How to use uploaded image? HOT 2
- Cannot make the request from the other domain. HOT 1
- async after-the-request action HOT 4
- toImage()
- Thanks for the great library. Is these any support for HTTPS? HOT 3
- "Aborted" error on any code. HOT 1
- getting image from a POST HOT 3
- Web server not working, waffle.lua module not found HOT 1
- Ability to add change port inside code
- loop or previous error loading module 'buffer' HOT 3
- Server hanging when making parallel requests for static content HOT 6
- Please add to torch rocks repository HOT 2
- Allow changing content type for static files HOT 2
- attempt to call method 'toImage' (a nil value) HOT 3
- ipv6 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from waffle.