I am an oldschool computertechnician started programming in the 70's in assembly on 6502 cpu.
Tiny basic was the first step on the long path of higher level programming languages in my career.
Annex rds is for me like a reunion with an old friend. :)
Iot is now my new challenge. Home automation system like Hue, Smartconnect, homewizard custom controlling and connecting with dmx and serial devices.
Using rest API's is an easy solution with Annex. The wget, wpost and json commands are very useful. But...
Two of my target devices are using the PUT method. So a lot of other api do so.
Is there a special reason for this omission? Is there a solution to emulate such.
Maybe a reason for implementing WPUT$ in the next revision?
Otherwise I have to switch inbetween to another relation e.g. arduino C :P
Api methode PUT
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1364 times
- Contact:
Re: Api methode PUT
Hi,
This method have not been implemented simply because is rarely used and then considered without any particular interest.
Actually it is not possible actually to emulate this function because it relies internally on a specific code
This is the first time that someone request for it, I'm surprised that you cannot achieve the same result using POST or GET.
Having said that, it should not hard to implement it in the future (for the ESP32)
This method have not been implemented simply because is rarely used and then considered without any particular interest.
Actually it is not possible actually to emulate this function because it relies internally on a specific code
This is the first time that someone request for it, I'm surprised that you cannot achieve the same result using POST or GET.
Having said that, it should not hard to implement it in the future (for the ESP32)
- PeterN
- Posts: 393
- Joined: Mon Feb 08, 2021 7:56 pm
- Location: Krefeld, Germany
- Has thanked: 184 times
- Been thanked: 221 times
- Contact:
Re: Api methode PUT
... not to mention the technical question....[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Wed Jan 25, 2023 2:48 am
Annex rds is for me like a reunion with an old friend.
I agree with that!
This is one of the best and most accurate sentences I have ever had the pleasure to read here!
Re: Api methode PUT
I believe many REST API's like to map the HTTP METHOD to correspond to database-like actions, typically mapping it as:[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Wed Jan 25, 2023 9:31 am This is the first time that someone request for it, I'm surprised that you cannot achieve the same result using POST or GET.
GET : Read
POST : Create/Insert
PUT : Update
DELETE : Delete
HEAD : I don't remember, but something to do with checking if a record has changed
so I can understand how this might be useful when connecting to an API that is not under your control. But as CiccioCB points out, it's probably not a big deal to POST from your ESP to your own server where you then "translate" to PUT to the foreign API.
On the other hand, I would also imagine that Annex uses a library for the HTTP functions (perhaps ESP AsyncTCP as listed in the help file). Perhaps that library can be used to bring arbitrary TCP support to Annex, a little like the UDP support, and then you could do your own PUT method?
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1364 times
- Contact:
Re: Api methode PUT
Yeah. Thanks. I pick up my project to control hue and tradfri lamps via a rs232 connection of the DCP controller/ barco movieprojector combination. Annex has al the possibilies gor making a gateway from serial to RESTAPIs in the hue inhouse gateway! In the language i understand...
I already used annex to create a visitors monitor fir our entrysystem.
The data is fetched via a POST from the Sumup cash system. A big 3x8x8 led display shows how many visitors are in.
Basic progam is about 20 lines and mostly comments.
And my follow volunteers are astonished. :D
Going on with the apipuzzle. Again thanks.
I already used annex to create a visitors monitor fir our entrysystem.
The data is fetched via a POST from the Sumup cash system. A big 3x8x8 led display shows how many visitors are in.
Basic progam is about 20 lines and mostly comments.
And my follow volunteers are astonished. :D
Going on with the apipuzzle. Again thanks.
From profession to hobby. Micro-computers still my challenge!