I'm trying to do a POST request from any of rest client like (Advanced rest client, Postman etc) for posting a request with mime type "multipart/related" but none of rest client supports. So is there a way to quickly POST a request from any of rest clients or other alternate solutions?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Though I have not tried multipart/related, but multipart/mixed using jersey client.
Using Jersey client
Create a multipart request .. eg.
MultiPart multiPart = new MultiPart();
multiPart.bodyPart(....//
Then call the service like :
Client c = Client.create();
WebResource service = c.resource(Url);
ClientResponse response = service.type("multipart/mixed").header(headerkey,
headervalue).post(ClientResponse.class, multiPart);
Similarly try it for multipart/related.
you have download jersery client jar from https://jersey.java.net/download.html
回答2:
Attached image will help you, This way you can try using Advance Rest Client plugin in Chrome, and also don't forget to upload the file under the Files tab.