0

Currently i am using WSO2 API manager 1.8.0 to secure my web service endpoints . There is a end point allow to upload file and text (multipart/form-data). Firstly, I have invoked the endpoint directly and got success. Then i create a API by using WSO2 AM and provide upload file end point for production and sandbox url. After invoked, i got exception regarding to "Body part ended prematurely. Boundary detected in header or EOF reached."

I have investigated and see that the content type is changed This is the correct one:

Content-Type: multipart/form-data; boundary=a65f7a9e-30a7-41ce-986b-e0ba8678cd7d

--a65f7a9e-30a7-41ce-986b-e0ba8678cd7d
Content-Disposition: form-data; name="type"
Content-Type: application/x-www-form-urlencoded 

MY_DA_TA
--a65f7a9e-30a7-41ce-986b-e0ba8678cd7d--

And this is the difference

Content-Type: multipart/form-data; charset=UTF-8; boundary=MIMEBoundary_f7e66aa74d83cdf3eca30fd8f62eff42fd5b2e5d627e4e78

--2819d1cd-319b-4d7b-9685-b9944b6e22e5
Content-Disposition: form-data; name="type"
Content-Type: application/x-www-form-urlencoded

MY_DA_TA

--2819d1cd-319b-4d7b-9685-b9944b6e22e5--

How can i correct that ?

1 Answers1

0

Just by glance I found a similar query [1]. Could you check if that works for you.

[1] multipart form data file upload using WSO2 API manger ?

Community
  • 1
  • 1
Udara S.S Liyanage
  • 6,189
  • 9
  • 33
  • 34
  • I have already did that but it still not work. I change to use the previous verison (1.7) and it work! I guess this is a bug of version 1.8 – Ân Phạm Minh Mar 31 '15 at 01:14