Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8226721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:52:19+00:00 2026-06-07T15:52:19+00:00

What status code should be returned if a client sends an HTTP request and

  • 0

What status code should be returned if a client sends an HTTP request and specifies a Content-Encoding header which cannot be decoded by the server?

Example

A client POSTs JSON data to a REST resource and encodes the entity body using the gzip coding. However, the server can only decode DEFLATE codings because it failed the gzip class in server school.

What HTTP response code should be returned? I would say 415 Unsupported Media Type but it’s not the entity’s Content-Type that is the problem — it’s the encoding of the otherwise supported entity body.

Which is more appropriate: 415? 400? Perhaps a custom response code?


Addendum: I have, of course, thoroughly checked rfc2616. If the answer is there I may need some new corrective eyewear, but I don’t believe that it is.


Update:

This has nothing to do with sending a response that might be unacceptable to a client. The problem is that the client is sending the server what may or may not be a valid media type in an encoding the server cannot understand (as per the Content-Encoding header the client packaged with the request message).

It’s an edge-case and wouldn’t be encountered when dealing with browser user-agents, but it could crop up in REST APIs accepting entity bodies to create/modify resources.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:52:22+00:00Added an answer on June 7, 2026 at 3:52 pm

    As i’m reading it, 415 Unsupported Media Type sounds like the most appropriate.

    From RFC 2616:

    10.4.16 415 Unsupported Media Type

    The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.

    Yeah, the text part says "media type" rather than "encoding", but the actual description doesn’t include any mention of that distinction.

    The new hotness, RFC 7231, is even explicit about it:

    6.5.13. 415 Unsupported Media Type

    The 415 (Unsupported Media Type) status code indicates that the
    origin server is refusing to service the request because the payload
    is in a format not supported by this method on the target resource.
    The format problem might be due to the request’s indicated
    Content-Type or Content-Encoding
    , or as a result of inspecting the
    data directly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If at all any error message should be returned with status code 405, what
For SEO purposes, we would like to change the HTTP status code returned whenever
If the URL is requested not using AJAX what status code should be returned?
In theory, this code should set the new lock status to the users and
I want to print just the HTTP status code for a web page retrieved
This code does a redirect, but uses a 302 status code: <cflocation url=http://stackoverflow.com addToken=no
I need help in parsing big Json file: {status:{code:200,text:OK},content:[{proposalId:12536,providerId:1,supervisorName:null,supervisorEmail:lolbroek_13@hotmail.com,hostInstitution:qsd,hostCountry:qsd,hostCity:QSD,hostTypeId:1,title:qsd,status:available,numberStudents:null,description:qsd,categoryId:34,startDate:null,endDate:null,submitDate:null,expectedWorkload:null,purpose:null,workOrganisationId:1,function:null,audienceId:1,preConditions:,certificationGranted:null,deliverables:null,expenses:null,revenue:null,vacancies:null,uploadImg:http:\/\/193.136.60.238\/\/MUTW2012\/core\/img\/internship.png}, {proposalId:12537,providerId:1,supervisorName:null,supervisorEmail:lolbroek_13@hotmail.com,hostInstitution:qsd,hostCountry:qsd,hostCity:QSD,hostTypeId:1,title:qsd,status:available,numberStudents:null,description:qsd,categoryId:34,startDate:null,endDate:null,submitDate:null,expectedWorkload:null,purpose:null,workOrganisationId:1,function:null,audienceId:1,preConditions:,certificationGranted:null,deliverables:null,expenses:null,revenue:null,vacancies:null,uploadImg:http:\/\/193.136.60.238\/\/MUTW2012\/core\/img\/internship.png}, {proposalId:12538,providerId:1,supervisorName:null,supervisorEmail:lolbroek_13@hotmail.com,hostInstitution:qsd,hostCountry:qsd,hostCity:QSD,hostTypeId:1,title:qsd,status:available,numberStudents:null,description:qsd,categoryId:34,startDate:null,endDate:null,submitDate:null,expectedWorkload:null,purpose:null,workOrganisationId:1,function:null,audienceId:1,preConditions:,certificationGranted:null,deliverables:null,expenses:null,revenue:null,vacancies:null,uploadImg:http:\/\/193.136.60.238\/\/MUTW2012\/core\/img\/internship.png}, {proposalId:12539,providerId:1,supervisorName:null,supervisorEmail:lolbroek_13@hotmail.com,hostInstitution:qsd,hostCountry:qsd,hostCity:QSD,hostTypeId:1,title:qsd,status:available,numberStudents:null,description:qsd,categoryId:34,startDate:null,endDate:null,submitDate:null,expectedWorkload:null,purpose:null,workOrganisationId:1,function:null,audienceId:1,preConditions:,certificationGranted:null,deliverables:null,expenses:null,revenue:null,vacancies:null,uploadImg:http:\/\/193.136.60.238\/\/MUTW2012\/core\/img\/internship.png}, ................[etc] I
Is it possible to send 100 Continue HTTP status code, and then later some
I have been asked by a client to return a 410 Status code for
Suppose we have the xhr 'POST' request that returns 'redirect' status code. In that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.