Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Mário Tomás
31
Views
3
Comments
[ardoHTTP] URL Template
Question
Forge
ardoHTTP (O11)
Forge asset by
João Barata
Hi,
I am doing a REST integration, but for now it will have to work on platform 7. So i am using new Rest functionalities on platform 9 test it, and replicate on 7 with ardoHTTP and ardoJSON.
My question is about the bahaviour of non mandatory fields and null values.
In Version 9, i can put a input field that will go on an URL as: 'isMandatory: No ; Send Default Value: No' this means that that field will not appear on the url if it has a null value, for instance '0' for a Integer field:
I thought that URLTemplate from ardoHTTP extension could be used for this, but i don't find a way to specify that the field should not be send if it is null. Have we a way to specify this? Thanks
Ricardo Silva
The URL Template function follows the
6570 RFC
.
From what I'm reading what you want is this syntax:
https://www.example.com/foo{?query,number}
This will add query and number if they're defined. So in your case you would add the following template:
.../api/v2/{?limit,offset,sync_token,service_ids,calendar_ids,calendar_ids__or} and add the variables to the list whether or not you want them to be shown.
Please let me know if this worked for you :)
Ricardo Silva
You can try it out
here
.
Mário Tomás
Thanks for the quick answer.
yes, i could work with this pattern.
I apply an url_template like: /api/v2/events/{?limit,offset,sync_token,service_ids,calendar_ids,calendar_ids__or}
and some if's validating the content of the inputs, to add or not the inputs as Variables.So for instance if limit=0, this input will not go to the list of variables, and will not be included on URL.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...