JSON

Returning raw JSON content from ASP.NET Web API

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 […]

Funky Web API Dance

Making your ASP.NET Web API funcky with an OWIN appFunc

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> […]

Boy JSON

Posting raw JSON to Web API

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 […]

Serialization

Troubleshooting serialization problems in Web API

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 […]

TekPub

A Tekpub API

Rob Conery asked for some feedback on an API he has been building for Tekpub.  I know that Rob asked for URLs, and URLs he shall get, but I like to get a better understanding of the relationships between my resources before I start minting URLs for my service.  On a number of occasions I […]

WCF IIS SQL

The world’s simplest WCF Web API

We all have to start somewhere, and I like to start with the simplest possible thing that works.  So I created a Console application and used NuGet to pull in the WebAPI.All package which contains all my dependencies.[1] Once that was done, all I need is this: If you point a browser to http://localhost:9000 you will get your first […]

WebApi

Web APIs: Don’t be a victim of your success.

It seems everyone these days wants an API for their web application.  Getting a primitive Web API up and running can be deceptively simple. However, what many people don’t realize is that with the success of an API can come a variety of problems. As developers, we are used to dealing with unforeseen problems, we […]

API DOCUMENT

How to write a document describing a REST Api

Roy Fielding wrote this post recently on the proliferation of APIs that claim to be REST but are breaking some of the fundamental constraints of a REST style architecture. I was most struck by what Roy seems to be saying is required to document a REST Api. That is it.  If you look at most API specs […]

footer bg

Let's Talk About Your Project

Ready to take your next development project to the next level? Click here to see how Bizcoder can bring your vision to life.

Case Studies

Copyright @ 2024 Kaynes