#array as get params

19 messages · Page 1 of 1 (latest)

grave kiln
#

Hello,
In my get api call i have one of the params as array. What should i give the type of params? Her i need to give the type for listofcarclasses. Can someone please help

Thanks,
Sathwika

#

Basically i need the datatype

#

For array params

orchid heron
#

It's an array of strings, right? string []

grave kiln
#

Yes

orchid heron
#

Or is it something else? Without knowing what the url normally looks like it'll be hard to say

grave kiln
#

[a,b,c,d]

#

I am trying in the following way but not sure right or wrong

orchid heron
#

Why did you do [string]?

#

[string] is an array of length one with its single value being of type string.

string[] is an array of undetermined length, with each value being of type string.

Array<string> is the same as string[] just with a different syntax

grave kiln
#

Ok thankyou so much for the explanation really helpful

#

What is the datatype of date?

orchid heron
#

Date?

#

Seriously, read up on Typescript's docs

grave kiln
#

Input params in url as date

#

Ok

#

In url

orchid heron
#

Well, if it's in a URL it'll be a string