Computer Related > Using REST APIs Miscellaneous
Thread Author: smokie Replies: 13

 Using REST APIs - smokie
Thanks. I seem to have HTTPie and CURL working OK, in that when I enter HTTP in my command prompt it comes back with the valid usage, as per that guide you linked.

But how do I input the example he has? This one.

C:> http POST localhost:50231/api/Contact name=scott age:=100
HTTP/1.1 200 OK
Content-Length: 26
Content-Type: application/json; charset=utf-8
Date: Fri, 17 Aug 2012 21:59:51 GMT
Server: Microsoft-HTTPAPI/2.0

{
"age": 100,
"name": "scott"
}


I'm thinking the second line onwards is the response so as the first line starts with c:> it looks like command prompt, in which case the same command for me gives

http: error: ConnectionError: HTTPConnectionPool(host='localhost', port=50231): Max retries exceeded with url: /api/Contact (Caused by NewConnectionError(': Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')) while doing POST request to URL: localhost:50231/api/Contact


Maybe it just needs something specific set up which I don't have. maybe my firewall has rejected it (on an internal connection request?)

But more to the point I'm assuming I am now at the point where I'm going to start doing a PERL script, to make the connection to Octopus then pass the parameters - is that so?
Last edited by: smokie on Sun 13 Jan 19 at 18:57
 Messages Author Date
 Using REST APIs new smokie 10 Jan 19 08:57
 Using REST APIs new Kevin 10 Jan 19 20:32
 Using REST APIs new smokie 11 Jan 19 09:16
 Using REST APIs new Kevin 11 Jan 19 23:27
 Using REST APIs new smokie 12 Jan 19 00:32
 Using REST APIs new smokie 12 Jan 19 09:03
 Using REST APIs new Kevin 12 Jan 19 22:34
 Using REST APIs new smokie 13 Jan 19 18:57
 Using REST APIs new Kevin 13 Jan 19 20:51
 Using REST APIs new Kevin 18 Jan 19 23:21
 Using REST APIs new smokie 19 Jan 19 08:11
 Using REST APIs new Kevin 19 Jan 19 23:11
 Using REST APIs new smokie 19 Jan 19 23:46
 Using REST APIs new smokie 8 Feb 19 08:15
Latest Forum Posts