Jump to content

Need a starting point for web service GET hooks


Kevin Connolly

Recommended Posts

I guess I just need to do more reading. So all I need is the starting point (for a Noon) to learn how to specify ALL the parameters needed to set an event trigger, such as a Geofence or an iBeacon. I tried Https:<username>:<password>@ipaddress:port/rest/nodes/<node>/cmd/<cmd>...or something like that. It worked fine in my web browser but not in the geofence app I want to use (the app supports GET and POST). I' m not exactly thrilled with the success of my web browser experiment either. Something just strikes as wrong to be sending the username and password as I was doing. I read something about encoding, but it wasn't written for a Noon so...

Any help would be appreciated.

Link to comment

I found this simple code to turn on a SwitchLinc somewhere on the internet (don't ask me where). it utilizes admin:admin encoded for username and password.

 

GET /rest/nodes/99999/cmd/DON HTTP/1.1\x0D\x0AHOST: 192.xxx.x.x\x0D

\x0AAuthorization: Basic YWRtaW46YWRtaW4=\x0D\x0A\x0D\x0A 

 

So my questions than (assuming the above will work) is:

Do I kick off the command with https://?

and do I append the IP with the port number (ie. 192.XXX.X.X becomes 192,XXX,X.X:443?

Link to comment

Hi Kevin,

 

The following will not work:

GET /rest/nodes/99999/cmd/DON HTTP/1.1\x0D\x0AHOST: 192.xxx.x.x\x0D

\x0AAuthorization: Basic YWRtaW46YWRtaW4=\x0D\x0A\x0D\x0A

 

What you need is \r\n after each line. \r = carriage return and \n is new line. I think you are sending the hex codes as string and that will not work.

 

What's your application framework?

 

With kind regards,

Michel

Link to comment

The application I'm trying to use is Geohopper on an iPhone. 

Bear with me, because as far as coding and such goes, I'm pretty much on the Dr.Seuss level. Would the following work?

 

 

GET /rest/nodes/99999/cmd/DON \r\n HTTP/1.1\x0D\x0AHOST: 192.xxx.x.x\x0D
\x0AAuthorization: Basic YWRtaW46YWRtaW4=\r\n\x0D\x0A\x0D\x0A

 

or do I place the (\r\n)'s somewhere else? and will this work for Https?

...and thank you, btw, for the help! You'd think that with the prevalence of mobile devices and such that the correct command would be easy to find where all a knucklehead like me had to do is switch out a few things. 

Link to comment

I took two screen shots on my phone, but there no way I can see to attach them here. If you have a direct email address I could send them to you. 

To answer your question...I don't know. Geohopper is a geofence application. it has a space to provide a URL and specify GET or POST. There's another similar application, geofancy, that does the same thing. I somewhat shied off geofancy because I couldn't pin down whether the developer was in the Netherlands or Australia.

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...