396
Views
2
Comments
Solved
Optional Query parameter in REST Method
Question
One of a Query parameter in my REST API Method is optional, how do i prevent that it is sent in the URL?
2024-12-17 14-32-59
Matthias Preuter
 
MVP
Solution
Matthias Preuter wrote:
For example the URL can be

https://host.com/method?par1=1&par2=2&par3=3

and

https://host.com/method?par1=1&par3=3

when par2 is empty, the parameter must not be sent.

 
 
 Already found it, 
  • Set mandatory: false
And Advanced properties:
  • Default value: empty 
  • Send default value: No

2024-12-17 14-32-59
Matthias Preuter
 
MVP
For example the URL can be

https://host.com/method?par1=1&par2=2&par3=3

and

https://host.com/method?par1=1&par3=3

when par2 is empty, the parameter must not be sent.


2024-12-17 14-32-59
Matthias Preuter
 
MVP
Solution
Matthias Preuter wrote:
For example the URL can be

https://host.com/method?par1=1&par2=2&par3=3

and

https://host.com/method?par1=1&par3=3

when par2 is empty, the parameter must not be sent.

 
 
 Already found it, 
  • Set mandatory: false
And Advanced properties:
  • Default value: empty 
  • Send default value: No

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