2

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.

Gregory Williams
  • 453
  • 5
  • 18

1 Answers1

3

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.

Gregory Williams
  • 453
  • 5
  • 18
  • 1
    Just leaving a link in case anyone else need it https://github.com/PerfectlySoft/PerfectAppTemplate/blob/master/Sources/Perfect-App-Template/utility/makeRequest.swift – moka2258 Nov 28 '17 at 13:53