Command post

Good morning everybody. I need to trigger an IoT device using ionic. Currently I can trigger the device using the Jquery library with ajax and everything works as expected. However, I want to implement the non-ionic command. The device is a Particle Photon development board. The configuration that works for web html currently is as follows:


	$.post(url, {params: "on", access_token: accessToken });

Can you elaborate as to what this means?

I’m trying a post command with ionic: $.post(url, {params: “on”, access_token: accessToken});
can help. above is in JQUERY. I would like to bring it to ionic

Ionic and jQuery are not substitutions for one another. You have posted in the “ionic-v1” subforum, which is for an extremely old version of software that should not be used for new projects. If you are not working on a legacy codebase, this is not the subforum you want to be in.

That may seem pointless to you, but modern Ionic works with three different frameworks: Angular, React, and Vue (and, you will notice, each has their own subforum here). Each of them comes with their own HTTP client. You need to pick one of them, and read its documentation for further information.

To get you started, here is Chapter 6 of the Tour of Heroes, which is Angular’s tutorial. It covers how you would do this sort of thing if you choose to use Angular, like me. If you want to go with React or Vue, move your question to the relevant subforum and I expect somebody familiar with those frameworks can guide you to equivalent resources for them.

thanks. I will observe what you said.