.net - Parse Ajax Posted JSON data in DelegatingHandler -


without going details of why want this, here want do.

json data posted using jquery so:

jq.ajax({     url: 'api/values',     type: 'post',     datatype: 'json',     data: { a: 'hello', b: 'world' } }); 

in webapi delegatinghandler, i'd parse content json:

protected async override task<httpresponsemessage> sendasync(httprequestmessage request, cancellationtoken cancellationtoken) {     var data = request.content.readasstringasync().result;     //data url encoded, want json...     //???     //...i'm going json string here      var response = await base.sendasync(request, cancellationtoken);     return response; } 

json.net time gets webapi method that's going handle it, it's doable, i'm not sure how.

note don't need typed or - plain json string do.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -