I used built-in "querystring" module in my project.
Here is my sample code
var querystring = require('querystring');
var postData = querystring.stringify({
travelDate: "19-Sep-2015",
travelDate: "05-Nov-2015",
});
console.dir(postData);
But it logs 'travelDate=05-Nov-2015'.
I expected to get the result 'travelDate=19-Sep-2015&travelDate=05-Nov-2015'
Is there any method to solve the problem?
Update : I illustrate my problem more details
I know the query parameters key should be unique.But I need to fetch data from the website.I observe it's format of Form Data.
They have identical Keys("travelDate") showed below.
_eventId:showWtLblResult
mode:searchResultInter
wvm:WVMD
tripType:RT
origin:KHH
destination:NRT
travelDate:19-Sep-2015
travelDate:05-Nov-2015
adults:1
children:0
infants:0
cabinClass:ECONOMY
promoCode:
pointOfPurchase:OTHERS
flightNumberOW:
fareOW:
flightNumberRT:
fareRT:
channel:PB
bookingSource:
skyscanner_redirectid:
flexTrvlDates:
So I can't wrap my request body concisely.
I am a little stubborn that I hope to keep my code concise.