I am working on an ASP.Net Web API 2 RESTful web service to import and export data from my database. For my export method, the client has several options for exporting data in different formats (for example, pdf, xml, etc.). I am trying to determine the best design for my interface so that the client can tell the service whose format will provide the data.
As far as I can tell, my 2 best options are to use the Accept Header with strings such as multimedia or add a parameter to the method in which the client can provide a format parameter in the query string. If I prefer to use the Accept header, this may be due to the use of custom media type strings.
It seems to me that using the Accept header will be more consistent with HTTP and RESTful standards, but using the format parameter in the query string will be easier to implement on the service side and for the client.
Can someone explain what are some of the advantages or disadvantages of these two designs?
Brian source share