Created
December 3, 2013 22:12
-
-
Save aamedina/7778485 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| (defn GET | |
| "Sends a GET request to the specified URI." | |
| [uri & {:keys [headers] :or {:headers {}}}] | |
| (xhr uri "GET" nil (merge *headers* headers))) | |
| (defn POST | |
| "Sends a POST request to the specified URI with the given payload." | |
| [uri & {:keys [body headers] :or {headers {} body nil}}] | |
| (xhr uri "POST" body (merge *headers* headers))) | |
| (defn PUT | |
| "Sends a PUT request to the specified URI with the given payload." | |
| [uri & {:keys [body headers] :or {headers {} body nil}}] | |
| (xhr uri "PUT" body (merge *headers* headers))) | |
| (defn DELETE | |
| "Sends a DELETE request to the specified URI." | |
| [uri & {:keys [body headers] :or {headers {} body nil}}] | |
| (xhr uri "DELETE" nil (merge *headers* headers))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment