Forum Discussion

johnary's avatar
johnary
Streaming Star
4 years ago
Solved

Way to Edit Header in JSON file?

I'm trying to load my json file into the feed url and continually keep getting the "The server returned an unsupported content type. Was expecting 'application/rss+xml', 'text/xml', 'application/xml' or 'application/json' but received 'text/html'" error. 

My json url is located at http://fff.infinityfreeapp.com/wp-json/tv/roku/

I suspect the problem has to do with the header content-type. The json file my plugin generates is "application/json; charset=UTF-8."  Would the addition of charset=UTF-8 to the content-type line cause this issue? If so, how do I eliminate it from the header of my json file?

Thanks for any help you can give me.

 

  • I was able to fix this problem by using Amazon S3 to host my json file. When uploading the file to my Amazon S3 bucket, it allows you to designate the content-type to application/json, which Roku needs to ingest your file.

    Special thanks to Baradanikto for the tip.

14 Replies

  • Content type is correct (application/json; charset=utf-8), it looks that your link/site is returning html instead of JSON, your should content your developer to fix that.

    Also, If you are looking for a robust solution to manage your content feed, then check out our OTTfeed.com platform, it will save you a lot of time and frustration managing and debugging your feed.

  • johnary's avatar
    johnary
    Streaming Star

    I was able to fix this problem by using Amazon S3 to host my json file. When uploading the file to my Amazon S3 bucket, it allows you to designate the content-type to application/json, which Roku needs to ingest your file.

    Special thanks to Baradanikto for the tip.

    • Zave's avatar
      Zave
      Binge Watcher

      johnary 

      I'm having issues setting up my Json Feed from my s3 bucket using CloudFront or CloudFormation.  Is this something you could help me with?  Thx in advance!

      • johnary's avatar
        johnary
        Streaming Star

        Sure thing.  I don't use CloudFront or CloudFormation. I edit my JSON file using a Wordpress plugin called WP Smart TV. The plugin creates a JSON file that I can upload to my S3 account. Here is how I do it:

        1) Set up an Amazon S3 account. This is free.

        2) Create a bucket in your S3 account. This is where your JSON file will live.

        3) Upload your JSON file to your bucket. When you add your file, be sure to click on the properties section and scroll down to the METADATA section. Click on the Add Metadata button. Under type, use System Defined. Under Key, choose Content-Type. Under Value, use application/json.

        4) Now that your JSON files has been uploaded to your bucket, you need to make it public. Select your file and click on the Actions menu and choose Make Public Using ACL. Confirm that you want to make the file public.

        Your JSON file is now available to your Roku channel. I know this sounds like a lot of steps, but after you do it a couple of times, it will only take you a minute or two when you want to update your JSON file.  Also, when you're ready to upload an updated JSON file, just use the exact same name and replace your old JSON file using the steps listed here. Your root directory feed for your Roku channel should look something like 

        I hope this helps and if you have any more questions, just let me know.