Created
January 29, 2014 17:28
-
-
Save stubbetje/8692794 to your computer and use it in GitHub Desktop.
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
request = (body,callback) -> | |
alert( body.toSource() ) | |
class Robot | |
http: (url) -> | |
httpClient = {} | |
methods = [ 'get', 'post', 'put', 'del', 'head' ] | |
methods.forEach (method) -> | |
httpClient[ method ] = (body,callback) -> | |
request( { | |
url: url, | |
method: method, | |
}, callback ) | |
httpClient | |
r = new Robot | |
r.http( "http://www.google.be" ).get() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment