3

Th frustration when you get a strignified json from a third party api, they say that's the best practice. Fml

Comments
  • 0
    Welcome!

    And what would be best practice then? And how else would you send JSON? Or are we not talking web APIs?
  • 0
    @ScriptCoded JSON as a JSON object, perhaps ?
  • 0
    @illegaldisease In an HTTP body? You know that even though there is encoding and media types, you still have to parse it, right?
  • 0
    @ScriptCoded Of course we have to parse it. Way better and convenient than trying to parse a string into an object. I know it will increase the body size, but having it 300 more bytes won't matter much when we are dealing with gigabit bandwidths.

    I am currently dealing with an API, who converts token to cookie, and they send the cookie as a whole string. I used another module to parse it effectively, which wouldnt be needed at all.
  • 1
    @illegaldisease Ehh... So that'd be payload > token > cookie > token > payload? Seems dumb, yeah...
  • 0
    The issue when you get an unparseable string
Add Comment