HTTP GET Request and REGEX?

Hello Guys.

I need to send some http get commands and filter them with REGEX. Do i need to use the built in functions “SendHttpGetRequest” or should i install the HTTP binding and use that for the job?

I need to send commands to a webserver, then get a “SID Token” then combine this with another url to get data…

I’ve checked the commands in “Postman” where it all works…

From your explanation it looks, like you have to do several things in sequence every time.
And it looks like you only need the Token for combining it in the second url.

Since you don’t need the token as a value itself (according to your), there is no need to put it in an item.
I would use a Rule to get the token and the needed data in one sequence.
No need for Http Binding in this case.

Hello.

Yes i have to make a rule that does following:

  1. Send a HTTP GET command with REGEX to get the token.
  2. The received token should be combined with a new URL and send, this should contain the data that should be in an item
  3. Log out of the interface

Yes.
I still think rules will be the best for your usecase.

rule "Rule Name"
when 
    // Cron or condition for the rule to get fired
then 

    // 1. Get Token
    var response = sendHttpGetRequest("YourUrl")
    // 2. Regex
    var token = transform("REGEX", "Expression", response)
    // 3. Use token for another url
    var Data = sendHttpGetRequest("http://myurl.com/" + token + "maybe/some/additional/text")
    // 4. Maybe Logout with another request if needed
    // 5. Do some stuff with your Data
end

You just need to get a useful when condition for your usecase.
If it needs to be fired on a time base Cron will do the job.
Otherwise an item state could be observed.
This depends on your needs.

Please check the transform docs for the regex stuff.
I have written down this rule on mobile without testing it now.