Git Product home page Git Product logo

Comments (5)

maddox avatar maddox commented on June 18, 2024

RESTful interface requires you to POST or PUT instead of a GET

It would be nice if we could have the option to provide the HTTP method for the URL.

I too have some of my own custom software that I have amazon-echo-ha-bridge pointing at and had to make my URL endpoints GETs. I'm not very comfortable with this, as GET urls are easy to hit and these URLs are pointing at potentially important things. I'd prefer they be POSTs or PUTs. If anything, it's more compliant with a REST system.

If anything, it'd be nice the default was POST.

from amazon-echo-ha-bridge.

armzilla avatar armzilla commented on June 18, 2024

I agree. I was initially worried/lazy about the difficulty of creating
templates for the post/put body nor had any use case that required a
different http method . Should be an easy add. Should be in the next
release this week.

On Wed, Aug 12, 2015, 12:23 Jon Maddox [email protected] wrote:

RESTful interface requires you to POST or PUT instead of a GET

It would be nice if we could have the option to provide the HTTP method
for the URL.

I too have some of my own custom software that I have
amazon-echo-ha-bridge pointing at and had to make my URL endpoints GETs.
I'm not very comfortable with this, as GET urls are easy to hit and these
URLs are pointing at potentially important things. I'd prefer they be POSTs
or PUTs. If anything, it's more compliant with a REST system.

If anything, it'd be nice the default was POST.


Reply to this email directly or view it on GitHub
#25 (comment)
.

from amazon-echo-ha-bridge.

maddox avatar maddox commented on June 18, 2024

Should be in the next release this week

Nice!! Thanks!

from amazon-echo-ha-bridge.

armzilla avatar armzilla commented on June 18, 2024

added in 28ba226

from amazon-echo-ha-bridge.

armzilla avatar armzilla commented on June 18, 2024

please try out in the preview v0.2.1 release. create a new device

{
"name": "test device",
"deviceType": "switch",
"offUrl": "http://192.168.1.201:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&DeviceNum=31",
"onUrl": "http://192.168.1.201:3480/data_request?id=action&output_format=json&DeviceNum=31&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget&newLoadlevelTarget=${intensity.percent}",
"contentType" : "application/json",
"httpVerb":"POST",
"contentBody" : "{"fooBar":"baz"}"
}

note the escape of quotes in the content body. currently no validation of the content type, invalid content types WILL explode!

from amazon-echo-ha-bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.