#Encoding an Object for an HTTP Get Call to an API.

5 messages · Page 1 of 1 (latest)

quiet lantern
#

I have an API that accepts an object as an API property for a GET request.

@ApiProperty()
@IsOptional()
RegistrationYear: { $gte: number; $lte: number };

How do I encode this object into the query params of an HTTP Get Call?

I have already encoded Arrays like &arrayName[]=value in the past but I don't know the synthax that NestJS will accept for Objects.

spark crescent
#

this is not a nestjs thing tho

#

this is related with typescript and class-validator; and the underlying http lib

#

are you using expressjs?

#

and which version of nestjs are you using? v11 or v10?