Click here to Skip to main content
13,343,856 members (75,407 online)

.NET Framework

 
AnswerRe: Why does Task.Factory not do what it's supposed to do? Pin
Richard MacCutchan26-Nov-17 22:35
protectorRichard MacCutchan26-Nov-17 22:35 
GeneralRe: Why does Task.Factory not do what it's supposed to do? Pin
Wiep Corbier26-Nov-17 22:44
memberWiep Corbier26-Nov-17 22:44 
AnswerRe: Why does Task.Factory not do what it's supposed to do? Pin
Gerry Schmitz27-Nov-17 4:29
memberGerry Schmitz27-Nov-17 4:29 
GeneralRe: Why does Task.Factory not do what it's supposed to do? Pin
Wiep Corbier27-Nov-17 8:00
memberWiep Corbier27-Nov-17 8:00 
GeneralRe: Why does Task.Factory not do what it's supposed to do? Pin
Gerry Schmitz27-Nov-17 8:52
memberGerry Schmitz27-Nov-17 8:52 
QuestionRead XLM data using Key in powershell Pin
Member 1338745922-Nov-17 22:54
memberMember 1338745922-Nov-17 22:54 
AnswerRe: Read XLM data using Key in powershell Pin
Richard MacCutchan22-Nov-17 23:53
protectorRichard MacCutchan22-Nov-17 23:53 
Questionerror: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
RAGHUNATH45616-Nov-17 5:31
memberRAGHUNATH45616-Nov-17 5:31 
I am using webapi in my mvc project and when ever I made a request from browser to api call I am getting the following error:

And i am using the .netFramework 4.0

Exception Details:

Server Error in '/' Application.

The format of value 'application/json; charset=utf-8' is invalid.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.FormatException: The format of value 'application/json; charset=utf-8' is invalid.


Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[FormatException: The format of value 'application/json; charset=utf-8' is invalid.]
   System.Net.Http.Headers.MediaTypeHeaderValue.CheckMediaTypeFormat(String mediaType, String parameterName) +119919
   System.Net.Http.Headers.MediaTypeHeaderValue..ctor(String mediaType) +23
   System.Net.Http.ObjectContent.BuildHeaderValue(String mediaType) +63
   System.Net.Http.ObjectContent`1..ctor(T value, MediaTypeFormatter formatter, String mediaType) +66
   System.Net.Http.HttpRequestMessageExtensions.CreateResponse(HttpRequestMessage request, HttpStatusCode statusCode, T value, HttpConfiguration configuration) +892
   System.Net.Http.HttpRequestMessageExtensions.CreateResponse(HttpRequestMessage request, HttpStatusCode statusCode, T value) +104
   System.Web.Http.Dispatcher.HttpControllerDispatcher.HandleException(HttpRequestMessage request, Exception exception, HttpConfiguration configuration) +191
   System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) +284
   System.Net.Http.DelegatingHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) +41
   System.Web.Http.HttpServer.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) +347
   System.Net.Http.HttpMessageInvoker.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) +55
   System.Web.Http.WebHost.HttpControllerHandler.BeginProcessRequest(HttpContextBase httpContextBase, AsyncCallback callback, Object state) +316
   System.Web.Http.WebHost.HttpControllerHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +77
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +103
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155


I searched in google but can't find the proper solution.

Please help me

AnswerRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
Richard MacCutchan16-Nov-17 6:14
protectorRichard MacCutchan16-Nov-17 6:14 
GeneralRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
RAGHUNATH45616-Nov-17 23:10
memberRAGHUNATH45616-Nov-17 23:10 
GeneralRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
Richard MacCutchan16-Nov-17 23:40
protectorRichard MacCutchan16-Nov-17 23:40 
GeneralRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
Dominic Burford12-Dec-17 3:47
professionalDominic Burford12-Dec-17 3:47 
GeneralRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
tJackydx29-Nov-17 4:33
membertJackydx29-Nov-17 4:33 
AnswerRe: error: The format of value 'application/json; charset=utf-8' is invalid. from webapi Pin
Dominic Burford12-Dec-17 3:46
professionalDominic Burford12-Dec-17 3:46 
QuestionMessage Closed Pin
10-Nov-17 15:18
groupDorothyeea10-Nov-17 15:18 
QuestionProblem validating data input to a DataTable Pin
Ernesto R.D.8-Nov-17 18:54
memberErnesto R.D.8-Nov-17 18:54 
AnswerRe: Problem validating data input to a DataTable Pin
Eddy Vluggen9-Nov-17 0:45
professionalEddy Vluggen9-Nov-17 0:45 
GeneralRe: Problem validating data input to a DataTable Pin
Ernesto R.D.9-Nov-17 1:57
memberErnesto R.D.9-Nov-17 1:57 
GeneralRe: Problem validating data input to a DataTable Pin
Eddy Vluggen9-Nov-17 3:49
professionalEddy Vluggen9-Nov-17 3:49 
QuestionCircle Progress in Visual Studio 2008 Pin
Member 135090597-Nov-17 17:25
memberMember 135090597-Nov-17 17:25 
AnswerRe: Circle Progress in Visual Studio 2008 Pin
Pete O'Hanlon7-Nov-17 22:47
protectorPete O'Hanlon7-Nov-17 22:47 
AnswerRe: Circle Progress in Visual Studio 2008 Pin
Gerry Schmitz8-Nov-17 5:01
memberGerry Schmitz8-Nov-17 5:01 
GeneralRe: Circle Progress in Visual Studio 2008 Pin
Member 135090598-Nov-17 14:48
memberMember 135090598-Nov-17 14:48 
QuestionCast issue with CaptureFileAsync() Pin
MA-Navinn26-Oct-17 3:54
memberMA-Navinn26-Oct-17 3:54 
AnswerRe: Cast issue with CaptureFileAsync() Pin
Richard MacCutchan26-Oct-17 4:30
protectorRichard MacCutchan26-Oct-17 4:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy |
Web03 | 2.8.180111.1 | Last Updated 16 Jan 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid