I want to create a multipart HTTP request using clj-http
. Multipart request is below:
--Boundary
Content-Type: text/xml; charset=UTF-8
Content-Id id1
xml1
--Boundary
Content-Type: text/xml; charset=UTF-8
Content-Id id2
xml2
--Boundary--
I am using this Clojure code to build the multipart request:
(post "url"
{:multipart [{:name "XML1"
:content Xml1
:encoding "UTF-8"
:mime-type "text/xml"}
{:name "XML2"
:content Xml2
:encoding "UTF-8"
:mime-type "text/xml"}]})
How can I add Content-Id
in the multipart?
If you treat the Content-Id as a header, add
:Content-Id "Id 1"
to your request map should help, change to :If you treat Content-Id as body, just put it in to body