Skip to content

Instantly share code, notes, and snippets.

@frankvilhelmsen
Created March 21, 2013 11:52
Show Gist options
  • Save frankvilhelmsen/5212488 to your computer and use it in GitHub Desktop.
Save frankvilhelmsen/5212488 to your computer and use it in GitHub Desktop.
Clojure SMS bulk sending multipart/form-data formular
(ns blog.sms
(use blog.common)
(:require [clojure.data.json :as json]
[clj-http.client :as client]))
(defn post "the data to sms gateway over http" [body]
(client/post "http://api/rpc/bulk/" {
:debug true
:multipart [
{:name "username" :content "******"}
{:name "password" :content "******"}
{:name "filename" :content "recipients"}
{:name "file" :content (clojure.java.io/file "recipient.csv")}]}))
(defn -main []
(print "sending sms over ******...") (flush)
(post "to;from;message\n**********;\"SMS\";\"Hi\"")
(println " done"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment