I am curious as to what is the standard nowadays for building APIs in terms of formatting the POST input parameters : json vs x-www-form-urlencoded ? Any pros and cons ? Does AWS lambda + SST influence on that choice ? I'm hesitant going one way vs the other...
r
Ross Coundon
11/19/2021, 8:43 AM
Maybe it's because we're very much in the nodejs camp when it comes to the backend but submitting json makes it easier to work with
s
Simon Reilly
11/19/2021, 8:46 AM
I think the format of an API should be consumer led. E.g, you want to enter a market that conventionally uses XML, then use XML.
All APIs I have integrated in the last two years have been Rest JSON API or graphql 👍
r
Ross Coundon
11/19/2021, 9:12 AM
Funnily enough, we've recently had to deal with some XML/SOAP from a 3rd party API recently, bloody awful!
e
Erik Robertson
11/19/2021, 3:13 PM
FYI, I'm going for the JSON route, it indeed makes everyone's life easier
ö
Ömer Toraman
11/19/2021, 3:37 PM
XML is still so common, at least among our clients 😭
Ömer Toraman
11/19/2021, 3:38 PM
But yeah in the most ideal form it should read the content type from the request Content-Type and Accept headers