Sunday, 15 January 2012

rest - Asp.Net Web API content negotiation -



rest - Asp.Net Web API content negotiation -

…api/emailmessage/?emailid=test123

i have written above url using web api email in json info format(email body, sender, cc, to, etc).

also, have requirement allow download of email along attachment same url.

one way using content negotiation. can utilize “mediatypeheadervalue("application/octet-stream")” send content downloadable.

question is…. 1. parameter in request user should request json content or download of content? or right way of asking content type http client? 2. on server side can read content type user asking , send appropriate info using case statement. there considered on server side in scenarios?

thank you, eric

the accept request header used inform server media types client supports. however, not concerned adding format= parameter uri request different format. not have negative impact on application.

rest asp.net-web-api asp.net-web-api2

No comments:

Post a Comment