I am curious as to what is the standard nowadays f...
# random
e
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
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
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
Funnily enough, we've recently had to deal with some XML/SOAP from a 3rd party API recently, bloody awful!
e
FYI, I'm going for the JSON route, it indeed makes everyone's life easier
ö
XML is still so common, at least among our clients 😭
But yeah in the most ideal form it should read the content type from the request Content-Type and Accept headers