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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:30:46+00:00 2026-06-02T11:30:46+00:00

I have a GPS device for which I need to get: – the last

  • 0

I have a GPS device for which I need to get:
– the last location
– an history of locations

Regarding the last location, I issue a GET on /devices/id_of_my_gps and it returns the data in json {“latitude”:2.3, “longitude”:4.5, “timestamp”: “2012-04-12T12:32:45Z”}

Regarding the history of location, I’m not sure about the best way to do it.
I’m thinking of issuing a GET on /devices/id_of_my_gps/history and providing “from” and “to” timestamps (the dates between which the history needs to be retrieved) as parameters in the query string. Is that breaking the REST approach ?

UPDATE

Would it be better to send the from/to parameters as data in json: {“from”:”2012-04-12T12:32:45Z”, “to”: “2012-04-15T12:32:45Z”} ?

  • 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-02T11:30:47+00:00Added an answer on June 2, 2026 at 11:30 am

    I’m thinking of issuing a GET on /devices/id_of_my_gps/history and
    providing “from” and “to” timetamps (the dates between which the
    history needs to be retrieved) as parameters in the query string. Is
    that breaking the REST approach ?

    No. REST doesn’t restrict the use of query parameters so there is nothing wrong with your approach.

    Would it be better to send the from/to parameters as data in json:
    {“from”:”2012-04-12T12:32:45Z”, “to”: “2012-04-15T12:32:45Z”} ?

    Use the earlier approach. You cannot issue GET and send data in the body as you propose. Entity body is not allowed with GET request so you will have to resort some other HTTP method (PUT or POST) if you need to send data in the entity body which in your case is not semantically correct.

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

Sidebar

Related Questions

have an app that finds your GPS location successfully, but I need to be
I have here a device which can give me GPS coordinates. The time interval
I want to get the current GPS Location from the user's device, and basically
I have the following problem: I have a Wintec WBT-202 GPS device which has
I have an application which receives GPS data from a mobile device as well
I have a Mio P550 device, which has a GPS included. I try to
I have an app that revolves around the device's GPS and the information that
I have a number of tracks recorded by a GPS, which more formally can
I have written an iPhone app that uses the iPhone's relative GPS location. I
I have a working application which gets the GPS Long/Lat of from a BlackBerry

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.