Posts
Published 14 November 2013
in archive
with tags
javascript
Whilst working on some instrumentation code, I had need to pass a function and an unknown number of arguments to another function which would then time the execution of that function. This turned out to be quite easy using fn.prototype.apply
.
Continue reading …
Published 24 October 2013
in archive
with tags
aspnet
,
webapi
You may have come across the error message No MediaTypeFormatter is available to read an object of type T from content with media type 'text/plain'.
during your adventures in ASP.NET Web API. Tonight it was my turn to be faced with this bothersome little 'issue'.
Continue reading …
Published 18 September 2013
in archive
with tags
urlrewrite
,
angular
,
iis
AngularJS has the ability to use HTML5 routing, which means that rather than having your application using a hash (#) sign and then the route, it can instead get rid of the hash and still function as a Single Page Application. For example:
Continue reading …
Published 18 September 2013
in archive
with tags
iis
,
webapi
,
cors
,
webconfig
If you're hosting your API on a different domain to your app, such as api.domain.com, you may be hitting into some cross-origin request roadblocks. In IIS, this is pretty easy to fix -- or well -- disable.
Continue reading …
Published 18 September 2013
in archive
with tags
webapi
,
json
,
api
,
csharp
Sometimes when you call a WebAPI through the browser, you'll be served XML. This may make it easier to read, but it's really not helping us when all we really want is JSON. Putting the following snippet into the end of Application_Start() in Global.asax.cs will force your WebAPI application to always send JSON.
Continue reading …