HTTP Enhancements
#1
Posted 12 April 2015 - 09:01 AM
Secondly I would love to see more HTTP Request Methods. I have a few RESTful APIs that I wish to use that make use of GET, POST, PUT, and DELETE; I would also like to make my own APIs which use these for some upcoming projects. The current implementation of the http api doesn't not allow anything other than GET and POST. I feel like it shouldn't be too difficult given the recent changes in CC for you to add in Java-side the http.put and http.delete in addition to the existing http.get and http.post. Having PATCH might be useful as well for some RESTful APIs, however it is a little less commonly used.
#2
Posted 12 April 2015 - 09:40 AM
#3
Posted 12 April 2015 - 10:03 AM
#5
Posted 12 April 2015 - 10:33 AM
#6
Posted 16 April 2015 - 06:53 PM
Cause it returns 401 http-codes with text which i need to use... (Like: {"message": "No Permitted"})
http.get( url ), http.post( url ) and http.return( ) should always return an Object
* Header (With the Code and so on...)
* Content (Even 404-Messages)
Or an mode?
http.enhanced( true ) - And now it should work?
+1
#7
Posted 17 April 2015 - 03:45 AM
SeaLife, on 16 April 2015 - 06:53 PM, said:
#8
Posted 17 April 2015 - 08:26 PM
the problem is, now the program check with "if h then" (h = http.get(url))
but now, everytime (even if the answer is 404), "h" would contain functions... "if not h then" would never happen then (eq. to "if h then" would always be true)
if enhanced mode is off, it'll return "nil" ohn failure.. like now...
with enhanced on, it should always return something.. like h.getResponseCode() (404, 201, 401, 403, ...) (even on failure, because it is not real a failure
#9
Posted 18 April 2015 - 12:16 PM
SeaLife, on 17 April 2015 - 08:26 PM, said:
the problem is, now the program check with "if h then" (h = http.get(url))
but now, everytime (even if the answer is 404), "h" would contain functions... "if not h then" would never happen then (eq. to "if h then" would always be true)
if enhanced mode is off, it'll return "nil" ohn failure.. like now...
with enhanced on, it should always return something.. like h.getResponseCode() (404, 201, 401, 403, ...) (even on failure, because it is not real a failure
Then there could be a function like hasFailed() to check if an error happened.
#10
Posted 18 April 2015 - 02:43 PM
Freack100, on 18 April 2015 - 12:16 PM, said:
SeaLife, on 17 April 2015 - 08:26 PM, said:
the problem is, now the program check with "if h then" (h = http.get(url))
but now, everytime (even if the answer is 404), "h" would contain functions... "if not h then" would never happen then (eq. to "if h then" would always be true)
if enhanced mode is off, it'll return "nil" ohn failure.. like now...
with enhanced on, it should always return something.. like h.getResponseCode() (404, 201, 401, 403, ...) (even on failure, because it is not real a failure
Then there could be a function like hasFailed() to check if an error happened.
That would still break backwards compatibility.
#11
Posted 18 April 2015 - 03:07 PM
flaghacker, on 18 April 2015 - 02:43 PM, said:
Freack100, on 18 April 2015 - 12:16 PM, said:
SeaLife, on 17 April 2015 - 08:26 PM, said:
the problem is, now the program check with "if h then" (h = http.get(url))
but now, everytime (even if the answer is 404), "h" would contain functions... "if not h then" would never happen then (eq. to "if h then" would always be true)
if enhanced mode is off, it'll return "nil" ohn failure.. like now...
with enhanced on, it should always return something.. like h.getResponseCode() (404, 201, 401, 403, ...) (even on failure, because it is not real a failure
Then there could be a function like hasFailed() to check if an error happened.
That would still break backwards compatibility.
Yes, it would break backward compatibility. But it won't be a big problem to update a program to these new "standards".
#12
#15
Posted 19 April 2015 - 08:41 AM
#17
Posted 21 April 2015 - 03:54 PM
ardera, on 20 April 2015 - 07:41 PM, said:
seems legit...
i like the idea...
it would help me to use JIRA RestAPI and some other POST (with Json) apis...
For Jira (e.g.) you've to edit the Header to send: Content-Type: application/json
if xhttp would make this possible, i will fall in love with @dan200
(Sorry for this bad english... im from Germany :I )
#19
3 user(s) are reading this topic
0 members, 3 guests, 0 anonymous users











