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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:00:17+00:00 2026-06-12T14:00:17+00:00

One of our REST APIs will cause a long-running process to execute. Rather than

  • 0

One of our REST APIs will cause a long-running process to execute. Rather than have the client wait for a long time, we would prefer to return an immediate response.

So, let’s consider this use case: An applicant submits an application, for which there will be an eventual result. Since this is a very high-scale platform, we cannot persist the application to storage, but must place it onto a queue for processing.

In this situation, is it acceptable practice to return the URI where the application will eventually live, such as http://example.com/application/abc123?

Similarly, would it be acceptable practice to return the URI of the result document, which represents the decision regarding the application, as part of the representation of the application resource? The result document will not be created for some minutes, and an HTTP GET to its URI (or the URI of the application for that matter) will result in a 404 until they are persisted.

What is the best practice in this kind of situation? Is it acceptable to hand out “future” URIs for resources?

  • 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-12T14:00:18+00:00Added an answer on June 12, 2026 at 2:00 pm

    From “RESTful Web Services Cookbook“

    Problem

    You want to know how to provide resource abstractions for
    tasks such as performing computations or validating data.

    Solution

    Treat the processing function as a resource, and use HTTP GET to fetch
    a representation containing the output of the processing function. Use
    query parameters to supply inputs to the processing function.

    This entails just GET requests on a URI that represents the processing function. Your example ‘http://example.com/application/abc123‘ URI. When returning a response you would include what information you have by now and use HTTP codes to indicate the status of the processing as already suggested by Tomasz.

    However…, you should not use this approach, if the subsequent application processing stores or modifies data in any way.

    GET requests should never have side effects. If the submittal of the application leads in anyway (even if only after being processed in from queue) to new information / data being stored, you should use a PUT or a POST request with the application’s data in the request’s body. See “Why shouldn’t data be modified on an HTTP GET request?” form more information.

    If they application’s submittal stores or modifies data, use the pattern for asynchronous processing: a POST or PUT request with the application’s details.

    For example

    POST http://example.com/applications
    

    which returns “201 Created” with the URI of the new application resource.

    or

    PUT http://example.com/applications/abc123
    

    which returns “201 Created” and

    Both would also return any resource information that is already known at that time.

    You can then safely perform GET requests on the URI of the new resource as they now only retrieve data – the results of the application processing so far – and no data is stored or modified as a result of the GET.

    To indicate the application’s processing progress, the GET request can either return some specific status code in the response (queued, processing, accepted, rejected), and/or use the HTTP response codes. In either case a “200 OK” should only be returned when the application’s processing is complete.

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

Sidebar

Related Questions

I have a REST web service which exposes 2 methods- [POST method] Client will
One of the programmers on our team is leaving for greener pastures. We will
Have come against an interesting problem and I'm stumped. Basically on one of our
We have a Rest API that requires client certificate authentication. The API is used
Our Application has a Class that wraps Jersey REST functionality. One Method is public
I have our first NodeJS server that's being deployed to a client server along
I'm building a new REST API that will replace a pre-existing one. The older
One of our Java applications uses a google API service account to process all
I have the following error with one of our web applications - Query3 failed:
We are in the process of planning for a rewrite of one of our

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.