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 6234675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:31:44+00:00 2026-05-24T10:31:44+00:00

Situation I’m trying to create a REST API, where users can request responses in

  • 0

Situation

I’m trying to create a REST API, where users can request responses in different formats.

For example, user can access:

example.com/oranges/1.xml (returns results in XML)

example.com/oranges/1.json (returns results in JSON)

Question

What’s the proper HTTP response to indicate that a specific response format is not available?

For example, user tries to access:

example.com/oranges/1.yml (unsupported format)

Do I throw a 404 or is there a better response?

  • 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-05-24T10:31:44+00:00Added an answer on May 24, 2026 at 10:31 am

    If you’re encoding the desired format in the URL, then 404 is indeed the correct response — it tells the client that it will never, barring server changes, be able to do anything with that URL.

    With proper HTTP content negotiation, using the Accept request-header (which would be the more RESTamentalist choice), the appropriate response for an unsupported type would be 406.

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

Sidebar

Related Questions

Situation: I want to provide a website service where users can enter some data
Situation: a user clicks on a link, the server gets the request and starts
Situation: Site with content protected by username/password (not all controlled since they can be
Situation: I have some persons with certain skills and they can/might belong to more
Situation: A user submits a url and my php script adds that url to
Situation I have a few single-responsibility Servlets that take a request, do their job,
Situation: I have website which calls WCF Service and i'm trying to understand it..
Situation There is a high chance that users will not interact directly with the
situation: A user inputs a user name and password. now the user enters a
Situation : C#, .NET 3.5, WinForms Objective : Form1 has a Button that can

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.