1
Solved

HTTP Request action Variable store issue

using GET method on an API successful return, website backend logged as success, but return value cannot be store in the tasker variable

I've checked %http_response_length the correct response length was output as I tested on PC browser, and my Device file permission was allowed, but the variable was empty after I perform the task.

Device:vivo X Fold3 Pro unrooted

kernel:6.1.84-android14-11-maybe-dirty

1 reply

Can you please export your task's description (not xml) so I can take a look? Long-click the task in Tasker->export description Thanks in advance

LJ

    Task: tasks

    

    A1: If [ %LastIP !Set ]

    

        A2: Goto [

             Type: Action Number

             Number: 7 ]

    

    A3: End If

    

    A4: HTTP Request [

         Method: GET

         URL: https://api64.ipify.org

         File/Directory To Save With Output: %CurrentIP

         Timeout (Seconds): 10

         Structure Output (JSON, etc): On

         Continue Task After Error:On ]

    

    A5: If [ %CurrentIP ~ %LastIP ]

    

        A6: Stop [ ]

    

    A7: End If

    

    A8: HTTP Request [

         Method: GET

         URL: https://some.api.output.json

         Headers: Authorization: Basic 

         Content-Type: application/json

         File/Directory To Save With Output: %Respond

         Timeout (Seconds): 20

         Structure Output (JSON, etc): On

         Continue Task After Error:On ]

    

    A9: If [ %Respond[msg] ~ success ]

    

        A10: Variable Set [

              Name: %Respond.ip

              To: %LastIP

              Structure Output (JSON, etc): On ]

    

    A11: End If

    

    

The data of the HTTP Request is in the %http_data viable after the action is ran. Please check that. Don't set the File/Directory To Save With Output field at all if you don't want to save the result to a file or directory.

Topic is closed for comments