I want to upload an image to dropbox using their API with http in flutter but dropbox API content-type is 'application/octet-stream', when I tried using http content-type like this(appplication/json) but not working, How can I use this application/octet-stream as my Http content type in flutter
2 Answers
Try to do something like this:
http.post(url,
headers: {"Content-Type": "application/octet-stream"},
body: your-image-data
1 Comment
SilenceCodder
I have a lot of headers so, I have to use Map. like this Map<String, String> requestHeaders = { 'Content-type': 'application/octet-stream', 'User-Agent': 'api-explorer-client', // 'Dropbox-API-Arg': '{"path": "/EasyBay/Project1/image.txt"}', 'Authorization': 'Bearer' + token }; Yet, It's not working.