com.pany.extapi.module.exception.MultipleAttachmentHeadersFoundException: Attachment multipart contained multiple headers [content-type, content-disposition], only a single header should be provided
The API documentation states no headers should be sent in the second body part. The following is a snapshot of what Gatling is sending:
Could be wrong defaults in AsyncHttpClient multipart support.
Or could be a design issue in your API that could not be conforming to multipart spec, “The API documentation states no headers should be sent in the second body part.” sounds very awkward to me and your Exception seems to suggest proprietary multipart implementation.
I hope to be able to find some time some day to review AHC multipart implementation but I’m afraid that won’t happen any time soon, except if it becomes a priority for some customers. Otherwise, feel free to investigate on the AHC side and maybe contribute.
Yes, there’s a thought or two that the implementation could have been done better (we’re talking c. 2010). To the best of my knowledge, there’s no reworking planned. I’m stuck with it.
A meaningful investigation is a little beyond my ability.
In a multipart/form-data body, the HTTP Content-Disposition general header is a header that can be used on the subpart of a multipart body to give information about the field it applies to
The key word (for me) is can, as distinct from must, so couldn’t this be optional? Regardless, that leaves Content-Type to deal with…