Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why "Invalid Content Type"

Tags:

marketo

Trying to update a data field on a lead record in Marketo. Using C#. I send:

{"action":"updateOnly","input":[{"email":"[email protected]","leadQuality":"Hot"}]}

And get back:

{"requestId":"d98e#14b2d7dd1f3","success":false,"errors":[{"code":"612","message":"Invalid Content Type"}]}

Why the Invalid Content type message? The field leadQuality is legit. The email address exists. I've tried a number of different fields and always the same message. Access token is good too.

like image 535
Dean Wooldridge Avatar asked Jan 27 '15 22:01

Dean Wooldridge


People also ask

What is content type example?

The Content-Type header is used to indicate the media type of the resource. The media type is a string sent along with the file indicating the format of the file. For example, for image file its media type will be like image/png or image/jpg, etc. In response, it tells about the type of returned content, to the client.

What content type means?

Definition of a Content Type. In technical terms, a Content Type is a reusable collection of metadata for a category of content, with its corresponding taxonomies that allows you to manage information in a centralized, reusable way.

What is content type in browser?

The content type status, part of an HTTP header, can tell a browser what type of content, e.g. a PNG image or an HTML page, is being transmitted. This will affect the way a browser will process the file.

What is default content type?

The default content type is usually “application/octet-stream” with the most generic MIME/type definition. The MIME/type is appropriate for any content type a web server is likely to serve.


1 Answers

Content-Type is a HTTP header. Usually, you set it to application/json for REST calls.

You should do this in the code where you generate the HTTP request or REST call.

I found text/json as Content-Type and Accept header value in one of the marketo examples. You might try one of the two choices.

like image 145
StephenKing Avatar answered Jan 02 '23 20:01

StephenKing