Image upload with status update


I cant able to upload image through status/update end point… but i got media id through media/upload end point… when i make a call with status=“hello”&media_ids=xxxxxxxxxxxxx ,only status wille be updated. can anyone tell me the exact status for this?


That sounds like you are not encoding the values properly. How are you making the request?


connection.setRequestProperty(“Authorization”, authorizationHeader);
connection.setRequestProperty(“Content-Type”, “multipart/form-data; boundary=” + boundary);//No I18N
String CRLF = “\r\n”;
out = new DataOutputStream(connection.getOutputStream());

        out.writeBytes("Content-Disposition: form-data; name=\"" + "status" + "\"" + CRLF);
        String status = (String) postBody.get("status");
        out.writeBytes("--" + boundary + "--" + CRLF);
        out.writeBytes("--" + boundary + CRLF);
        out.writeBytes("Content-Disposition: form-data; name=\"" + "media_ids" + "\"" + CRLF);


(Please indent code with 4 spaces, so it is displayed properly)

A request to the POST statuses/update endpoint should be www-form-encode, this means the body should be something like this: status=foooo&media_ids=bar


Ya i tried it by appending parameter as status and media_ids ,but even though its not working. More over i ve sent content type as “application/x-www-form-urlencoded”

{“data”:{“errors”:[{“message”:“Could not authenticate you.”,“code”:32}]}}


This looks like your OAuth Code is not capable to deal with www-form-encoded content correctly.


But status updated correctly then y not image doesnt upload?



Did you get this issue fixed?

Even I’m facing the same issue for the last couple of days.

If you have managed to get this fixed, can you please paste the code how the POST request is being framed??