I found 1 question about this question that partially answered the question, but I'm afraid I might need some details.
I am currently trying to use BlobStore with my Android application, and I can not get anything but error 501 (HTTP server cannot process your request).
He is my code;
HttpPost httpPostImg = new HttpPost(url);
Header header = new BasicHeader("Content-Type", "multipart/form-data");
Header h = new BasicHeader("Connection", "keep-alive");
MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
FormBodyPart form = new FormBodyPart("myFile",new ByteArrayBody(image,"multipart/form- data","pict.jpeg"));
entity.addPart(form);
httpPostImg.setEntity(entity);
httpPostImg.setHeader(header);
httpPostImg.setHeader(h);
response = httpClient.execute(httpPostImg);
processResponse(response);
I get the url with a GET request that works pretty well. I will also try a FormBodyPart containing ByteArrayBody, and also set the mime type for ByteArrayBody to "multipart / form-data", but nothing worked. I always get error 501 (the server cannot process your request).
Thanx, all answers are welcome.
source
share