Created
March 21, 2013 11:52
-
-
Save frankvilhelmsen/5212488 to your computer and use it in GitHub Desktop.
Clojure SMS bulk sending multipart/form-data formular
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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