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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:05:21+00:00 2026-05-15T15:05:21+00:00

I have a REST web service which exposes 2 methods- [POST method] Client will

  • 0

I have a REST web service which exposes 2 methods-

  1. [POST method] Client will supply a list of objects in the form of an XML. My web service method will insert/update the list of objects based on one attribute in the object [mode = insert/update], and will return an XML with the list of objects and their status[whether insert/update was successful].
  2. [POST method] It will accept a list of objectIds and return the status of these objects from the server in the form of an XML.

I know that we should use

  • GET method for retrieving information
  • POST method for creating a new entry
  • PUT method for updating an existing entry.

I know that our implementation violates some of the REST constraints but our requirement forced us to implement it that way.

My question is – Is it ok to bend the constraints to accomodate our requirement?

  • 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-15T15:05:21+00:00Added an answer on May 15, 2026 at 3:05 pm

    What you are trying to do can be done RESTfully. Although POST is commonly used to add a single entity to a collection, it can also be used to submit a chunk of data to a “data processing resource”. This pretty much opens the door to do anything you want with a POST.

    People frequently misunderstand the REST constraints and believe that you MUST use PUT and DELETE in order to be RESTful. This is not the case. There is no requirement to use all of the methods. The only requirement is not to misuse the ones you do use.

    Obviously it is going to be more intuitive to a user of your API if you POSTed a single entity to a collection to create an entity. However, if this is not a viable option for you then you are free define a new media type that can contain a set of objects to be created/updated by some data processing resource.

    The important thing is to be explicit about these rules. You should create a new media type, like application/vnd.yourcompany.objectlist+xml and you need to write documentation about how that media type should be structured.

    Now that you have defined the media type your client is going to need to know where to POST that list of objects. Ideally you would define a new link relation (e.g. objectprocessor) that can be used in other documents to provide an URL to POST to. In the specification document of that Link relation you should explain to client developers, that when you post an application/vnd.yourcompany.objectlist+xml to a link that has the link relation objectprocessor then what is going to happen is x, y, and z.

    Assuming your root URL returned some kind of XHTML document like:

    <html>
      <h1>My awesomely restful service that can create objects in batches</h1>
      <link rel='objectprocessor' href='http:/example.org/myservice/objectprocessor'/>
    </html>
    

    A client application could process this document, discover this link and understand based on the link relation definition that it needs to POST a application/vnd.yourcompany.objectlist+xml to the endpoint specified in href.

    In this way, the message is completely self-descriptive, you are interacting with resources identified with URLs that are discoverable and you are within the rules of the uniform interface.

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

Sidebar

Ask A Question

Stats

  • Questions 513k
  • Answers 513k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The C++ standard states in chapter 23, Containers library that… May 16, 2026 at 6:02 pm
  • Editorial Team
    Editorial Team added an answer You need a UIImagePickerController, and then you create a UIView… May 16, 2026 at 6:02 pm
  • Editorial Team
    Editorial Team added an answer If you're using jQuery 1.4+, you should be able to… May 16, 2026 at 6:02 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

While creating a simple client for a REST service which I have stubbed out,
I have a REST web service that returns an xml result like this: -
I want to write my first REST web service using the .Net framework. I've
First a bit of background: We have a growing RESTful service layer supporting web
I'm using Jersey to create a REST web service for a server component. The
What is the best way to access a Rails 3 REST-ful web service, developed
I am attempting to get the WCF Rest Service Template 40 (CS) which is
I have looked at nearly every single WCF Rest PUT/POST issues on SO here
I have a Visual Studio solution containing a web site project plus a bunch
I am normally used to using JSON/REST. I have been given access to a

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.