GAE/J: How do I POST a Multipart MIME message from appengine to facebook

后端 未结 1 1044
执念已碎
执念已碎 2021-02-06 14:46

I want to post a photo (stored in appengine db) to facebook.

To test I\'ve got the basic understanding down locally: I\'ve been successful with this for

相关标签:
1条回答
  • 2021-02-06 14:57

    Solved!

    I needed to add:

    connection.addRequestProperty("Content-length", mpEntity.getContentLength()+"");
    connection.addRequestProperty(mpEntity.getContentType().getName(), mpEntity.getContentType().getValue());
    

    Also changed:

    MultipartEntity mpEntity  = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
    

    Hope this helps someone

    0 讨论(0)
提交回复
热议问题