WebApi 2 + Owin Use urlencoded body on token request
<p>In my WebAPI2 app I use OAuth authentication through Owin middleware. In order to get token client should use application/x-www-form-urlencoded body in request. </p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code> function userAccount($resource, appSettings) {
    return {
        registration: $resource(appSettings.serverPath + "/api/Account/Register", null, 
                {
                    'registerUser' : { method : 'POST'}
                }
            ),
        login : $resource(appSettings.serverPath + "/Token", null, 
                {
                    'loginUser': {
                        method: 'POST',
                        headers: {
                            'Content-Type' : 'application/x-www-form-urlencoded' 
                        },
                        transformRequest: function (data, headersGetter) {
                            var str = [];
                            for (var d in data) {
                                str.push(encodeURIComponent(d) + "=" + encodeURIComponent(data[d]));
                            }
                            return str.join("&amp;"); 
                        }
                    }
                } 
            )
    }
}</code></pre>
</div>
</div>
</p>

<p>But is there any method to override this behaviour to use raw body in json format? Instead of this: "grant_type=password&amp;username=user&amp;password=123456" want to use this: "{ grant_type: "password", username:"user", password="123456" }".</p>

<p>Appreciate any suggests.</p>