I am making an API call by using fetch method(GET) of Jquery. My question is, how can include empty input fields (totally optional, user may fill those areas, maybe not) into my fetch url. When I tried to send them as empty string, server is responding with a status code(400)- bad request.
These are the optional input fields to fill

MY JAVASCRIPT CODE
var fetchUrl = "https://test.api.amadeus.com/v2/shopping/flight-offers?originLocationCode="
+iataOrigin+"&destinationLocationCode="
+iataDestination+"&departureDate="
+getFlightDepartureDate()+"&adults="
+getFlightAdults()+"&max="+getmaxTicket()
console.log(fetchUrl)
const settings = {
"url": fetchUrl,
"method": "GET",
"headers": {
"Authorization" : "Bearer myTokenInHere"
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
For instance, I want to declare a URL such as 'adult number input field value' is not initialized, it's an empty string. Like this :
"&adults="
After trying this, server is not responding with a status code 200. I would be very thankful for your help.