The one great thing about twitter is that you quickly find out what you failed to explain clearly 🙂 My efforts in advocating for single purpose media types failed to clarify that by single purpose, I am not suggesting that these media types should not be re-usable. Let me try and explain. My realization was triggered by @inadarai ‘s […]
With the recent surge of interest in hypermedia APIs I am beginning to see the term “self-descriptive” thrown around quite frequently. Unfortunately, the meaning of self-descriptive is not exactly self-descriptive, leading to misuse of the term. Consider the following HTTP requests, Example 1 Example 2: I suspect a fair number of people will be surprised […]
In a previous post I talked about how to send raw JSON to a web API and consume it easily. This is a non-obvious process because ASP.NET Web API is optimized for sending and receiving arbitrary CLR object that then get serialized by the formatters in the request/response pipeline. However, sometimes you just want to have more […]
The OWIN specification defines a delegate called appFunc that allows any OWIN compatible host to work with any OWIN compatible application. This post shows you how to turn an ASP.NET Web API into an AppFunc. AppFunc is defined as , using AppFunc = Func<IDictionary<string, object>,Task>; In other words, a function that accepts an object that implements IDictionary<string,object> […]
I see questions almost weekly on StackOverflow where someone is trying to POST JSON and receive it as a string. The problem is that Web API has two modes, “serialized object” and “HTTP message”. Receiving raw JSON as a string falls between the two. Usually the question goes something like, “Why does the jsonBody parameter in the […]
This is my attempt to make the HTTPbis caching rules more accessible and hopefully shine a light on how powerful HTTP caching can be. I’ve been working on a Pluralsight course that talks about how to use the Microsoft HttpClient library. One of the areas I cover is how to take advantage of HTTP caching. […]
A few months ago I put up a site http://hypermediaapi.com with the intention of using it as place to aggregate links to all things hypermedia related. I built the site using Web API because a) I know how to use it, and b) I wanted to prove a point that a Web Site is really […]
I see many questions on Stackoverflow and the MSDN forums where people are having difficulty because the objects they are trying to return from there API are not being serialized as they expect. Consider you have an API action that looks like this: What are you supposed to do to debug what is going wrong […]
Ever since Microsoft’s first efforts to deliver a REST style framework in .net, back in 3.5, there has been a continuous stream of questions that has asked: how to I add a service reference to that API? How do I generate a client proxy? How do I access the WSDL for the REST service? Can […]