Start a new topic

Custom Endpoint Header Content-Type

Is there any way to change the content-type of the response header in a custom endpoint? Setting header properties works just fine, but Content-Type seems to always to be hard set to json.

What are you trying to set the content-type to? What is the use case? Are you using the REST API to call the endpoint or one of the libraries?



As an example, let's say I want to hit an endpoint with your REST API. This endpoint would be used to grab various values from collections and parse a small number of responses into CSV format. It would then (ideally) return a response with actual CSV content-type headers. Best solution for something like this, without having to parse anything on the client-side? Can an endpoint maybe create a Kinvey file directly?
There's no current way to set the content type to a non-JSON value, but we are considering non-JSON content types for a future enhancement. As you pointed out, you can create a Kinvey file by using the request module to access the REST file API. Otherwise, you will have to parse it client side, although depending on what you're developing the client side with, shouldn't be too bad.
Login or Signup to post a comment