Post request - fetch || XmlHttpRequest || axios #1484
-
Hi, i started using MQTTX a few weeks ago and I really like using it and working with it. Everything has worked up until this point. I have writen a Post Request in a custom script but it does not seem to do anything. I get the following error(s):
Is it even possible to send a Post Request in the script page or was it never meant to do that? Basically i have a back-end data stream which sends messages to a topic, which needs to be published to a react-native application. My script now detects if the type of a message is 'message' or 'error' and if it is error, it has to post data to a push notification service so that the smartphone receives a direct update. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello again! Thank you for your continued interest in MQTTX. Based on your requirements, it's important to clarify that MQTTX is a test client application not designed to be embedded within other applications. This means it cannot directly handle HTTP requests or perform similar functionalities within your application. However, if you have MQTTX installed, you can interact with it using shell scripts. This approach allows you to use MQTTX as a standalone MQTT client, carrying out publish and subscribe operations via SHELL scripting. This can serve as a method to interface with your React Native app or other backend services. For your specific requirement of sending notifications through a push service when an 'error' message type is detected, you should handle these logics in your backend service and interact with MQTTX for message publishing and subscribing through shell scripts. If you need more information on how to use MQTT in a React Native application, our blog might provide helpful guidance: How to Use MQTT in React Native. I hope this information is helpful to you. Please don't hesitate to reach out if you have any other questions or need further help. Best regards, |
Beta Was this translation helpful? Give feedback.
@thomasdierickx
Hello again! Thank you for your continued interest in MQTTX. Based on your requirements, it's important to clarify that MQTTX is a test client application not designed to be embedded within other applications. This means it cannot directly handle HTTP requests or perform similar functionalities within your application.
However, if you have MQTTX installed, you can interact with it using shell scripts. This approach allows you to use MQTTX as a standalone MQTT client, carrying out publish and subscribe operations via SHELL scripting. This can serve as a method to interface with your React Native app or other backend services.
For your specific requirement of sending notific…