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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:57:19+00:00 2026-06-09T16:57:19+00:00

Specifically, here’s the scenario in case: A a request can have a body (POST

  • 0

Specifically, here’s the scenario in case: A a request can have a body (POST or PUT) which is formatted in a format specified in the Content-Type header — say, application/json. However, the URI includes a formatting hit for a different format (say as ?_format=xml or resource_uri.xml) which is usually used to denote the response formatting. I see three possible solutions here:

  1. The Content-Type of the request is ignored and the request body is parsed as if it’s in the format denoted by URI.
  2. The URI mark is ignored and both request and response are assumed to be formatted as defined by Content-Type.
  3. The request body is parsed according to the Content-Type, and the response is formatted as hinted by the URI.

Personally I like the approach #3, but am a bit worried about the difference in the formats. What is the usual practice here, is it acceptable to have request and response in different formats? If not I’d prefer approach #1, while #2 seems totally off and unintuitive. Any suggestions here?

  • 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-09T16:57:21+00:00Added an answer on June 9, 2026 at 4:57 pm

    Approach #3 is the only sane of the three, also allowing the request and response to be in different formats. This is a good thing, as typically the request is in one fixed format while the response can be rendered in whatever supported format the client prefers.

    Approach #1 obviously abuses HTTP and should never see the light of day.

    Approach #2 is also quite bad because there is a different header for what response format the client expects: Accept.

    So in a nutshell: you can do it the way HTTP intended (using the Accept header), or provide some convenience to the clients by allowing the format to be specified inline in the URL. You could also do both (if the Accept header specifies a format then use that, otherwise also check the URL).

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

Sidebar

Related Questions

i have set up Wiki:Family using the tutorial #2 specified here http://www.mediawiki.org/wiki/Wiki_family Specifically, i
Specifically how can I: Show a button which will let the user browse through
( insert really basic question disclaimer here ) More specifically, I have the following
Here is what I'm specifically trying to do: I have written a HttpModule to
I am specifically intertested in #270. You can see it here: http://railscasts.com/episodes/270-authentication-in-rails-3-1 I've downloaded
Here's my issue: I have 3 tables, with overlapping information (specifically, the username) in
I have read about javascript editors here, more specifically refered this link How to
Found this while reading the Neo4j manual, specifically here , I found the sentence:
Specifically: I have a Schedule model where a person cans schedule one event per
Specifically, I am always hitting Ctrl-A instead of Ctrl-S which is really annoying because

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.