AutoWeb Issue with escaping/encoding in url path

Discussion in 'AutoApps' started by klingeling, Jun 19, 2016.

  1. klingeling

    klingeling New Member

    Joined:
    Jun 19, 2016
    Messages:
    5
    Likes Received:
    0
    Hello,
    I created an AutoWeb API to control my Kathrein satellite receiver (API PDF).
    There is an issue with escaping/encoding characters, when using INPUTS.

    In the example pic you can see the green and the red log.

    Green: If I put the text direct in the API action config dialog, AutoWeb sends the characters without modifying and the receiver gets the text in the correct form and decodes the %20 to a space.

    Red: When I use the AutoWeb Inputs to be able to use variables in tasker, AutoWeb modifies my input by encoding/escaping the % to %25. In this case my receiver shows "hello%20world" instead of "hello world".

    [​IMG]

    Another example is the + character to switch channels or increase the volume. With an AutoWeb Input it gets converted to %2B and the receiver can't interprete it.

    Can you please make an option in the Inputs dialog to send the variables unmodified? I shared my API to your server, if you will take a look.

    Thank you very much!
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Any reason why you are URL encoding the variables before putting them in AutoWeb? :)

    About the + character, to correctly send that in a URL it must be converted to %2B... Could it be that the API is not correctly url decoding after receiving it?
     
  3. klingeling

    klingeling New Member

    Joined:
    Jun 19, 2016
    Messages:
    5
    Likes Received:
    0
    Thank you for answering :) The text interface Api of the receiver needs the text this way. When I put the variables as raw text, a SPACE gets encoded to + by AutoWeb instead of %20 and the receiver does not decode the + back to a SPACE. So why is the part of the path from the Action Config not urlencoded by AutoWeb, but the part in the Inputs Config is? By now it seems not possible to send a SPACE as %20 by using Inputs, or do you know any workaround?

    The receiver api doesn"t accept %2B as a + when receiving button inputs for p+ and vol+. But I've found a workaround for this problem by using spaces in the Inputs Config:

    p :Channel up
    p-:Channel down
    vol :increase Volume
    vol-:decrease Volume

    This way AutoWeb replaces the spaces with + and the command works.

    Thank you for helping!
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Ok, I'll make AutoWeb encode spaces as %20 instead of +. Sorry, should've been that way all along! Thanks for your feedback!
     
    klingeling likes this.
  5. klingeling

    klingeling New Member

    Joined:
    Jun 19, 2016
    Messages:
    5
    Likes Received:
    0
    Hi, thanks for changing the behaviour of the spaces but now I have another problem ;-)

    Now it is no more possible to send the + character, which is needed for switching the channels and the volume. Can you please make it possible again with one of the next updates?

    I know, the receiver api is very picky :)
    Thanks again!

    Edit:
    I think it is ok, as it is now. Text input is working great without the need of an extra step of text encoding in Tasker. I can leave the channel and volume operations as single actions without using inputs. This way the + gets send as it is :)
     
    Last edited: Jun 24, 2016
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Great! :)
     
: AutoWeb, Kathrein

Share This Page