question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Boundary not added automatically to headers for multi part (AEM server 6.1)

See original GitHub issue
   @Multipart
    @POST("/crx/packmgr/update.jsp")
    @Headers("Content-Type: multipart/form-data; charset=UTF-8")
    fun updatePackage(
            @Part("path") path: String?,
            @Part("packageName") packageName: String,
            @Part("groupName") groupName: String,
            @Part("version") packageVersion: String = "",
            @Part("description") description: String = "",
            @Part("filter") filter: String,
            @Part("_charset_") charset: String = "UTF-8"
    ): Single<PackageResponse>

` Jan 24, 2019 1:10:48 PM okhttp3.internal.platform.Platform log INFO: --> POST https://qa.author.st.com:8088/crx/packmgr/update.jsp http/1.1 Jan 24, 2019 1:10:48 PM okhttp3.internal.platform.Platform log INFO: Content-Type: multipart/form-data; charset=UTF-8 Jan 24, 2019 1:10:48 PM okhttp3.internal.platform.Platform log INFO: Content-Length: 1540 Jan 24, 2019 1:10:48 PM okhttp3.internal.platform.Platform log INFO: Host: qa.author.st.com:8088 Jan 24, 2019 1:10:48 PM okhttp3.internal.platform.Platform log INFO: Connection: Keep-Alive Jan 24, 2019 1:10:48 PM okhttp3.internal.platform.Platform log INFO: Accept-Encoding: gzip Jan 24, 2019 1:10:48 PM okhttp3.internal.platform.Platform log INFO: Cookie: login-token=61f72fad-2693-49e3-a89d-db37e7926d8e%3af16817d3-7f1f-4b3b-a0d5-57f4232b33e1_8d173c0bb246cf68%3acrx.default Jan 24, 2019 1:10:48 PM okhttp3.internal.platform.Platform log INFO: User-Agent: okhttp/3.12.1 Jan 24, 2019 1:10:48 PM okhttp3.internal.platform.Platform log INFO: Jan 24, 2019 1:10:48 PM okhttp3.internal.platform.Platform log INFO: --f30bd60b-95c6-464b-bb53-edf710141c5b Content-Disposition: form-data; name=“path” Content-Transfer-Encoding: binary Content-Type: text/plain; charset=utf-8 Content-Length: 32

/etc/packages/6D-temp/test-1.zip –f30bd60b-95c6-464b-bb53-edf710141c5b Content-Disposition: form-data; name=“packageName” Content-Transfer-Encoding: binary Content-Type: text/plain; charset=utf-8 Content-Length: 4`

Server response 24.01.2019 10:44:33.969 *ERROR* [qtp504462445-94283] com.day.crx.packmgr.impl.support.HttpMultipartPost Error while processing multipart. org.apache.commons.fileupload.FileUploadException: the request was rejected because no multipart boundary was found

browser request headers: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9,ru-RU;q=0.8,ru;q=0.7 Cache-Control: max-age=0 Connection: keep-alive Content-Length: 1049 Content-Type: multipart/form-data; boundary=----WebKitFormBoundary9QKaR8Q1as5jUUt7

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

27reactions
JakeWhartoncommented, Jan 24, 2019

Delete your explicit @Headers annotation. The content type is added with a boundary automatically for all @Multipart requests.

2reactions
VatslauXcommented, Jan 25, 2019

@JakeWharton Thank You - it works. Is it possible to set a custom boundary pattern? like --xxxxxxxx If server expected for example timestamp

Read more comments on GitHub >

github_iconTop Results From Across the Web

fetch - Missing boundary in multipart/form-data POST
I removed "Content-Type" and added 'Accept' to http headers and it worked ... to detect and set the boundary and content type automatically....
Read more >
RFC1341(MIME) : 7 The Multipart content type
The boundary must be followed immediately either by another CRLF and the header fields for the next part, or by two CRLFs, in...
Read more >
Multipart formposts - Everything curl
A multipart formpost is what an HTTP client sends when an HTML form is submitted with enctype set to "multipart/form-data". It is an...
Read more >
RFC 7578: Returning Values from Forms: multipart/form-data
RFC 7578 multipart/form-data July 2015 Table of Contents 1. ... As noted in Section 5.1 of [RFC2046], the boundary delimiter MUST NOT appear...
Read more >
Uploading MultipartFile with Spring RestTemplate - Baeldung
This quick tutorial focuses on how to upload a multipart file ... When this header is set, RestTemplate automatically marshals the file data ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found