multipart

How to POST a request in any of rest clients for mime type as “multipart/related”

心不动则不痛 提交于 2019-12-14 03:59:24
问题 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(....//

How to send “multipart/related” content type in PHP

倾然丶 夕夏残阳落幕 提交于 2019-12-14 03:45:24
问题 I need to send multipart/related content with PHP. The content will exist of 3 files (2x XML, 1xPDF) The XML-files need to be encoded as 7bit The PDF-file needs to be encoded as base64 I can build a file like this,but then i cant figure out how to send it with curl in PHP. The content should be something like this (i stripped out most of the encoded pdf). This exapmle comes from another closed-source application: MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_0

Using .eml for HTML Mail Signature

笑着哭i 提交于 2019-12-13 18:40:01
问题 Ideally for HTML Mail signature in Outlook Mail (windows) we use .htm file and place that file in folder Users\UserName\AppData\Roaming\Microsoft\Signatures Lets Suppose: HTML Markup: <img src="someImage"> For embedding image as an attachment, I will have to use cid so the HTML Markup changes to: <img src="cid:0123456789"> Since this image is referencing to some cid in multipart/related. So the referenced part would be something like this i.e --boundary Content-Type: image/png; name="sig.png"

Spring REST API with Multipart File Upload not working for optional parameter

痴心易碎 提交于 2019-12-13 15:11:56
问题 I'm using Spring framework, but not too familiar with it. I'm writing a REST API, specifically a POST method that handles a file upload where the file is optional. I've tried to simplify the method down but still having a problem. Here is what I have @RequestMapping(method = RequestMethod.POST, value="/items") public String create(@RequestParam(value="file", required=false) MultipartFile file) { return "Create"; } The method works fine when I include a file in my form request, however when I

Help constructing a POST request with MultipartEntity (newbie question)

时光怂恿深爱的人放手 提交于 2019-12-13 13:09:25
问题 I'd like to construct a multipart request, with the following parameters: name (string), email (string), and fileupload (file). I'm using the Java code below (working in Android). The httppost.getRequestLine() prints POST http://www.myurl.com/upload HTTP/1.1 So everything looks good on the client site, but my server (Django/Apache) reads it as a GET request, with no GET parameters - request.method produces 'GET', request.GET.items() produces an empty dictionary. What am I doing wrong? I don't

Multipart/Formdata image upload, get the file

对着背影说爱祢 提交于 2019-12-13 12:33:52
问题 in my app i want to upload an image chosen via UIImagePickerController to a database which only accepts JPEG images. I've browsed many questions in here, and in other forums but i still didn't get it to work. I hope you can check my code, if there is a mistake which i can't see. This is the complete method for uploading, with an image description, an image title, and the geodata for this image: - (void) uploadPic{ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,

Parse a JSON body after multipart ajax Angular call

风格不统一 提交于 2019-12-13 09:01:17
问题 I'm trying to parse a body that is coming to me after an api call using ajax angularJs. After call the response is: --3531b7e68196e3144197f82db0864b7e391c8b0ad51c4176c28f8ac41b3c Content-Disposition: form-data; name="passport"; filename="passport.json" Content-Type: application/json { "name": "Nothing", "dob_display": "10/11/1997", "dob_accuracy": "FD", "owner_firstname": "Nothing", "owner_surname": "To Understand" } --3531b7e68196e3144197f82db0864b7e391c8b0ad51c4176c28f8ac41b3c-- I didn't

BodyParser parse data instead of connect-multiparty in node.js

自古美人都是妖i 提交于 2019-12-13 08:58:27
问题 I am trying to upload file using connect-multiparty with reference of connect-multiparty below is my express.js config for that. app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json()); //file upload configuration app.use(multipart({ uploadDir: config.tmp })); but when I upload file than it gives me request size if too long. I search for this and found that I need to set limit so I have also put limit parameter like below: app.use(bodyParser.json({limit:'50mb'})); but

What did I miss to send a http part post request

笑着哭i 提交于 2019-12-13 08:07:45
问题 I am trying to send an image using http multipart request (later I will add another image) I did this: HttpClient client = HttpClientBuilder.create().build(); HttpPost httpPost = new HttpPost( "http://localhost:8080/ServletExample1/multipart1"); httpPost.addHeader("Content-Type", "multipart/related; boundary=HereItGoes"); MultipartEntityBuilder builder = MultipartEntityBuilder.create(); FileBody bin = new FileBody(new File("./test.txt")); builder.addPart("bin", bin); HttpEntity entity =

Gmail API replaces text/plain alternative body part with automatically generated one from HTML

a 夏天 提交于 2019-12-13 06:44:41
问题 I'm sending emails from Android devices using the Gmail API with an alternative text/plain version. The email is structured as follows: multipart/mixed multipart/alternative text/plain text/html attachment Everything works great, except for the text/plain part, which is being replaced by a sanitized version extracted from the text/html part. If I try sending to the same address as the sender (from email X to email X), both the original text/plain and text/html versions are maintained. If I