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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:12:16+00:00 2026-05-24T19:12:16+00:00

We are creating a service to perform conversions from one format to another. Examples

  • 0

We are creating a service to perform conversions from one format to another. Examples of conversions are currencies, distances, times, languages, etc. In our case it is geographic points (for example from decimal degrees latitude/longitude to degrees-minutes-seconds latitude/longitude).

Typically a RESTful resource has an analogous OO concept that is persistent on the server side that can be CRUDed (I know this is only part of what makes something RESTful), but in the case of a simple service that converts things, that doesn’t necessarily exist. How would one make this RESTful? Currently we have some like this:

To get the list of supported formats one can do this:

GET /coordinates/formats

Which would return a list of formats, including, for example DD and DMS (decimal degrees and degrees-minutes-seconds).

One can then turn around and perform a conversion like so:

POST /coordinates/DD/as/DMS

In this example one would pass a representation of decimal degrees (as JSON or some other format) in the request body, and receive a representation of degrees-minutes-seconds in the response body.

This of course works, but feels unRESTful, in particular because the same URI is used over and over for different inputs (different decimal degrees). The trick is probably to really concentrate on what the resource being manipulated it. Perhaps its a “Conversion”:

POST /coordinate/conversions

The body might take in the a value, its format, and the desired output. However, the URI is still the same for all resources…

Thoughts?

  • 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-24T19:12:16+00:00Added an answer on May 24, 2026 at 7:12 pm

    I would suggest using parameters and GET. I also would switch path elements and make /conversions your root-resource, as conversion is your “domain-core”.

    Main reasons are:

    • From api-client perspective above is easier to use (no POST payload, very easy to test/try-out). Client friendliness is one of the highest priorities for api-design.
    • GET fits better because you don’t “change” anything on the server side but rather convert things.
    GET /conversions/coordinate?input=xxx&format=yyy
    

    I like your approach to give back metadata with /conversions/formats. It makes formats easy to lookup and your api more self-explainable. The respective data then forms the possible value for ‘format’-parameter from above call.

    Or are you storing conversion (which would favor state-changing POST method)?

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

Sidebar

Related Questions

I am creating a service, that needs to perform the following tasks: consult bank
I am creating a Windows Service in C# that processes messages from a queue.
I am creating a service which receives some data from mobile phones and saves
I am creating a service that looks similar to this: interface MyLogger { void
We are creating a service which requires MSMQ, and it might happen the boxes
I am currently creating a service which connects to a DAL and that can
When creating a new service in a WCF service project, Visual Studio will automatically
Im creating a Windows Service and I want to put a dynamic path in
I am creating a windows service and want to know best practices for this.
I am creating a Windows service. When an exception occurrs, I handle it appropriately

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.