mardi 21 mars 2017

Multiple content-types for request in webservice

I have one webservice which can take multiple content-types in request

text/plain 
application/json

Now, client can send any of them either json or text. I have two options available on server

  1. I can create separate apis for different content types
  2. I can parse request data and check if its json or text?

What is better approach here?Is there a design pattern suited for this need?

Aucun commentaire:

Enregistrer un commentaire