Http device for XML, JSON devices or web APIs.
Http driver in bOS is used for XML, JSON devices integration or web APIs.
Picture 1: HTTP node
In bOS, users have multiple connection types available. Serial, TCP, UDP and TCP server. Connection settings must be set accordingly, setting correct COM port must be set if the connection is serial, correct IP and port if the connection is TCP, etc.
To correctly connect to the integrated device, correct Host URL must be set. If the device requires authentication, fill in the Username and Password. Under Parsing option, select the correct encoding and parsing type, depending on the device integration. For the communication, Command node must be added into bOS. For this test, we add Test under command function.
Again created HTTP device and a Listener device. For regex parsing, parser type is set to Text and under Command setting, set Method Type to GET.
Listener device also needs to have parser setting set to Text. To get the correct response from our HTTP, we need to use the correct Regex command.
Additional information regarding the regex commands can be found:
[http://regexstorm.net/reference](http://regexstorm.net/reference)
In this case, we will need to use command: “(?<=GET /)\w+” to get the correct response, in this case the response is''Test ``.
Picture 2: HTTP regex command
We use cookies to personalize content, use live chat, provide social media features and to analyze our traffic. We also share information about your use of our site with analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.