Gregory Williams
Gregory Williams

Reputation: 421

Send a json post request from a server side swift perfect application to another http api rest application

I would like to create a Swift server side Perfect application that calls another REST API by posting a query formatted in JSON and receive JSON back but am very new to Perfect and server side Swift in general so I am not sure how to do it. I know how to do it from a Swift iOS client application but just not sure how to do it from Perfect. Could someone please help me? I see examples on how to do it using get on the Perfect web site but the server I am posting to only accepts JSON posts. If someone knows of an example I could look at it would be much appreciated. Thanks in advance.

Upvotes: 2

Views: 587

Answers (1)

Gregory Williams
Gregory Williams

Reputation: 421

I asked on the perfect slack channel and nawar told me of makerequest which will do this in Perfect Swift part of the PerfectAppTemplate in the utility section in case anyone else needs to do that. I tested that part and it works.

Upvotes: 3

Related Questions