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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:54:59+00:00 2026-05-27T12:54:59+00:00

I’m writing a Plain Old XML HTTP request/response service and am looking for advice

  • 0

I’m writing a Plain Old XML HTTP request/response service and am looking for advice as to how to respond to the caller.

Given that the response is XML, would you advise:

  1. Return HTTP Status 200 all the time, and embed the response success/failure inside the XML, using a kind of “return code” approach? e.g. <myResponse><returnCode></returnCode><myPayload/></myResponse>

  2. Use the HTTP Status Codes to indicate success or failure.

This may be similar to this question.

  • 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-27T12:55:00+00:00Added an answer on May 27, 2026 at 12:55 pm

    Google and Amazon services use returning 200 only if your request was valid AND the response is valid.

    For example using Google Contact API

    • If you request a Contact that exists: 200 + XML/Json of Contact
    • If you request a Contact that does not exists: 404 + Xml/Json with Details
    • If your request is formatted improperly: 400 + Xml/Json with Details
    • If you have not sent the authorization token: 401 + Xml/Json with Details
    • If you attempt to Insert a contact using Get or Put: 405
    • If you Attempt to Insert a Contact using Post: 200 (assuming the request contant was valid)
    • If you Attempt to Update a Contact using Get or Post: 405
    • If you attempt to Update a Contact using Put: 200 (assuming the request contant was valid)
    • If you Attempt to Delete a Contact using Get, Put, Post: 405
    • If you attempt to Delete a contact using Delete: 200 (assuming the request contant was valid)

    I would highly recommend you do NOT always return a 200. The HTTP Status codes are designed around a response code result that represents the request. As shown above, if you request is not correct, then using HTTP Status codes is a valid solution.

    I would recommend using a 5XX if there is a problem on your end. I really wish Google would do this. (At one point their Experimental OAuth 2.0 endpoint was not working, and instead of throwing a 503 – Service Unavailable, I was getting a 400 – Bad Request, which made me thing I was doing something wrong….)

    For descriptions of the HTTP Status Codes check out RFC2616.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I need a function that will clean a strings' special characters. I do NOT

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.