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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:04:56+00:00 2026-05-21T03:04:56+00:00

Suppose I have Task and TimePeriod. TimePeriod represents the time I have worked on

  • 0

Suppose I have Task and TimePeriod. TimePeriod represents the time I have worked on the task using start_time and end_time fields.

I would like for Task to support Starting/Stopping the task. Start will create a new TimePeriod with the current time. Stop will add end_time to the last TimePeriod.

I was thinking the REST URL will be like this:
PUT /tasks/1011?do=start
PUT /tasks/1011?do=stop

or maybe
PUT /tasks/1011/start
PUT /tasks/1011/stop

What is the proper way to make this REST style?

  • 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-21T03:04:57+00:00Added an answer on May 21, 2026 at 3:04 am

    Here is one alternative. Retrieve the task like this,

    GET /task/1011
    

    Then to start the task, POST it like this,

    POST /ActiveTasks  
    

    and to end the task,

    POST /InactiveTasks   
    

    In reality it doesn’t matter what the URIs look like if you use the following representation for a task resource:

    <Task>
      <Description>Do some stuff</Description>
      <Status>Active</Status>
      <Link rel="end" Method="POST" href="/InactiveTasks"/>
    </Task>
    

    or

    <Task>
      <Description>Do some stuff</Description>
      <Status>InActive</Status>
      <Link rel="start" Method="POST" href="/ActiveTasks"/>
    </Task>
    

    Note that only one of the links will be available at any one time, depending on whether the task is currently active

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

Sidebar

Related Questions

Suppose we have the name written in any none-latin letters - languages, like Arabic,
I have an issue here. Suppose you have a business periodical task, for instance
Suppose I have a task that is pulling elements from a java.util.concurrent.BlockingQueue and processing
Suppose I have some Ant task - say javac or junit - if either
Suppose I have a function that performs some task (this is in Python pseudocode):
Suppose I have the following method. def create_multiple project = Project.find(params[:project]) params[:tasks].each_value { |task|
Suppose you have to accomplish this quite generic task: Given a string, we'll say
So suppose I have two Models -- Project and Task I want user to
I'm using Java 6. Suppose I have an enum with 6 values, ordered A
Suppose I have a todo file (todo.txt) which looks like this : Call Tom

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.