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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:13:19+00:00 2026-06-12T09:13:19+00:00

I have a restful webservice for which iam writing a new method call. The

  • 0

I have a restful webservice for which iam writing a new method call. The purpose of the new method call is to revoke the status of a person to “NO”.

All that I have to send in the request is a Person_Id for which the status needs to be changed to “NO”.

Should I be using PUT or POST to do this?

If I use put, can I just send the person_id as a path parameter and not use any xml at all.
(like : http://serverName/PersonServices/Person/123456) and in the service layer, i have my code like this.

    @PUT
    @Path("/Person/{person_Id}")
    @Consumes("application/xml")
    @Produces("application/xml")
    public JAXBElement<GetUsageTokenType> updateLicenseStatus(
            @PathParam("person_Id") final Long personId) {

            //code to change the status
     }

Or should I be using POST to do this…
Am I right in saying that if I use POST, I need to send xml format?

  • 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-12T09:13:20+00:00Added an answer on June 12, 2026 at 9:13 am

    If you look at Which HTTP methods match up to which CRUD methods? there shows the mapping

    Create = PUT with a new URI
             POST to a base URI returning a newly created URI  
    Read   = GET  
    Update = PUT with an existing URI  
    Delete = DELETE
    

    If you read the HTTP RFC for each verb’s definition you can see why…

    In response to:

    can I just send the person_id as a path parameter and not use any xml
    at all

    then ideally your URL

    http://serverName/PersonServices/Person/123456

    should probably be

    http://serverName/PersonServices/RevokePerson/123456

    This will help for maintainability if you don’t want to pass any XML/JSON/etc but whether human-readable URLs are a feature of RESTful services is a llloooonnnggg-running argument

    As alluded to in the comments RESTful APIs should focus on content and not actions. See: Why does including an action verb in the URI in a REST implementation violate the protocol? for example.

    So you’d pass a person to a URL and based on the HTTP verb the relevant CRUD action is taken. If you want to pass just an ID then you’re going to have to guess what update to take when you PUT to the ID… unless you know that there’s never going to be any other update ever ever ever.

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

Sidebar

Related Questions

I have a restful webservice which receives some structured data which is put straight
I have a RESTful service that, when I try to save a new record
I have a Scala application that relies on an external RESTful webservice for some
Assume I have a RESTful web service, which holds information about an object that
I have a RESTful webservice which i can successfully ping on the published server
I have a RESTful web service which runs on Glassfish Application Server. When I
I have a restful web service which can deal with DTOs in json format
I have a ReSTful web service which needs to parse locale-sensitive data from the
I have created a RESTful PHP web service using Lithium which contains comments, each
I have a DESKTOP application which interacts with a web service through their RESTful

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.