365
Views
3
Comments
Solved
REST API GET with empty value parameter
Question

hi,

I'm trying to consume a REST API which requires parameter with empty value in URL in some cases.

It looks something like below (the underlined part).

~/apimethod?TARGETPARAM=&OTHERPARAM=VALUE


When sent from the "Consume REST API Method" test tab, the request is sent exactly as written above and it gives me correct response.

However, when it's sent from some Action, outsystems seems to omit the empty value parameter.

Log shows request sent was 

~/apimethod?OTHERPARAM=VALUE


I tried setting TARGETPARAM={InputParamter} and passing InputParamter a blank text, but obtained same result.


Is there any way to get around this?

I'm currently on version 10, soon moving to 11.

thanks in advance

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Hi Sho,

Set the parameter's "Send Default Value" Property to True, and it should be sent always, even if empty. Note that for Integer Parameters, a "0" will be sent as that's an Integer's default value. But Text Parameters should be empty.

UserImage.jpg
Sho Katayama

hi Kilian,

Yes, it worked!

Thanks for the help!

many thanks

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

You're most welcome. Happy coding!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.