Anyone know of a Clojure library (or wrapper) for posting HTTP
multipart/form-data?

Do you mean submitting or receiving?

If you mean submitting, clj-apache-http will allow you to do it.

<http://github.com/rnewman/clj-apache-http>

Simply create any Apache HttpEntity and pass it as the value of :body.

<http://james.apache.org/mime4j/apidocs/org/apache/james/mime4j/message/Multipart.html?is-external=true > <http://hc.apache.org/httpcomponents-client/httpmime/apidocs/org/apache/http/entity/mime/HttpMultipart.html >

For example:

(require ['com.twinql.clojure.http :as 'http])
(import 'org.apache.http.entity.mime.MultipartEntity
        'org.apache.http.entity.mime.content.StringBody
        'org.apache.james.mime4j.message.BodyPart)

(let [body (doto (MultipartEntity.)
             (.addPart "partone" (StringBody. "Hello, world")))]
  (http/post
    "http://foo.com/";
    :body body))

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to