Skip to content
Advertisement

Tag: multipartform-data

Update default Content-Type for multipart form-data request in Android

We are currently using okhttp3 and retrofit2 in Android to make an network api call of type POST with multipart/form-data, the api request and response are as shown below If you observe, the request header Content-Type has “multipart/form-data; boundary=xxxxxx-xxxx-xxx….” Following is the code I’m facing an issue with sending the customised request header Content-Type as “multipart/form-data; **charset=utf-8;** boundary=xxxxx-xxxxx-x…..” basically i

Sending Image files and Text from android app java HttpURLConnection multipart form-data

Hi I am trying to upload a file and a text, using multipart form-data HttpURLConnection java, sample of code below: additional details: I/File:: /storage/emulated/0/DCIM/100ANDRO/DSC_0117.JPG I/Api response: 400, Bad Request Note: I tested server from postman, and it working with no issues with Postman, the files where uploaded successful to the server from postman. This link is another post of a sample

Java JSON String problem encoding Multipart

I’m developing a REST API that receives a MultipartFormDataInput object (org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput), this comes from a form-data Vue.js app. On the data field comes a json string that contains latin accent characters (á, é, í, ó, ú, ñ). When print the json data in Java I get this: Original Json string Json string received in Java What can i do to

How to send a multipart file to a service from another service

I have two endpoints api which are /uploadand /redirect /upload is where I directly upload the file. /redirect is where i receive the file and pass it to upload and get the JSON response from /upload.So below is my code: The endpoint /upload works pretty much fine.But when i call /redirect it throws an error of “exception”: “org.springframework.http.converter.HttpMessageNotWritableException”, “message”: “Could

Advertisement