I am tickled pink to have networking operations now. Thank yo very much. However for a little bit I thought you only supported GET operations.
Why? Because the one and only one call is called
http.get() and you have to read all the way down to find out you can do other operations.
As a suggestion, perhaps in a future version you could have
http.post(), etc calls as well. Even if they are just wrappers for
Also The documentation lists the possible methods as HEAD, GET, PUT, POST, and DELETE. Am I actually limited to them, or can I use any arbitrary method name? I ask because I have some WebDAV code I would like to adapt, and would like to be able do LOCK, UNLOCK, COPY, MOVE, etc operations as well.
You pass the method as text - ill bet it could be anything. Try it!
And yes - http.get() as a name is… Odd. I suspect it’s an artifact of the dev process, in that iirc, originally you couldn’t override the method. Not 100% sure there - it was a long beta
Would you prefer it to be named http.request?
We can leave .get as a deprecated version in the next update.
Request is 4 letters too many the new keyboard is awesome, but not that awesome!
I’d say drop the http. And just make it “get” if you change it at all.
Hmmm… Did we ever add https support?
@simeon: I prefer a function for each method. It’s clearer to the eye and documentation. The ‘http’ namespace “demands” some methods. But, if it’s not possible for whatever reasons, http.request() would be sufficient.
@bortels: I disgress if the ‘http’ got dropped completely. ‘get’ is too common name for a method in public namespace; to get what? And, ‘https’ should be THE 4th parameter.
@Bortels I’d say ‘get’ is a little too generic to not be namespaced! ‘http.’ gives it some context.
Wget then? Like the command line program…
I’m actually used to http.get() now, so meh.
@simeon I would like
http.request() for the generic operation, and then wrappers for GET, PUT, POST since they are the most common things to do.
BTW what about the second part of my question? Am I limited to just HEAD, GET, PUT, POST, and DELETE?
@JockM that sounds like a good idea. We’ll try move on this quickly so “get” can be changed appropriately.
You can set the method (I believe even to a custom string) and add custom headers.
@Simeon Awesome, on both accounts.