Some services and devices require that sent queries include the content-type parameter set as application/x-www-form-urlencoded in the header.
Such situation occurs, for example, in the case with the Tedee lock integration where the following request must be sent to obtain a token:
Note! In place of {username} and {password} enter the appropriate data.
In this situation the settings of the HttpRequest virtual object should look as follows:
The script that sets the contents of the RequestBody property looks as follows:
Note! The & character has appeared before the grant_type parameter.
During setting the value of the RequestBody feature, keep in mind the special characters that need to be encoded:
: | / | ? | # | [ | ] | @ | ! | $ | & | ' | ( | ) | * | + | , | ; | = | % | spacja |
%3A | %2F | %3F | %23 | %5B | %5D | %40 | %21 | %24 | %26 | %27 | %28 | %29 | %2A | %2B | %2C | %3B | %3D | %25 | + |
Note! The unencoded characters & and = separate the parameters and their values.