How would I deal with something like an optional (or required) query parameter in a call?
Something like:
v1/meal_plans?date=2016-01-01
This is assuming that date may or may not necessarily be an attribute of meal_plan. Perhaps for instance, meal_plan contains a field called meal_date and I want my call to GET meal_plans within a range that looks like this:
v1/meal_plans?start_date=2016-01-01&end_date=2016-01-03
I saw you mention the Query object in another answer, but the suggestion you gave was to use an internal version of the Query(url:) initializer.
How would I deal with something like an optional (or required) query parameter in a call?
Something like:
v1/meal_plans?date=2016-01-01
This is assuming that
date
may or may not necessarily be an attribute ofmeal_plan
. Perhaps for instance, meal_plan contains a field calledmeal_date
and I want my call to GET meal_plans within a range that looks like this:v1/meal_plans?start_date=2016-01-01&end_date=2016-01-03
I saw you mention the Query object in another answer, but the suggestion you gave was to use an internal version of the Query(url:) initializer.
Any help would be appreciated!