Questions tagged [restful-url]

Representational state transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web.

https://en.wikipedia.org/wiki/Representational_state_transfer

1351 questions
6
votes
2 answers

Web API Best Practice for Deep Object Routes

When designing a RESTful API with ASP.NET Web API, I can create several routes to retrieve the same data. But should I? Is it considered helpful or confusing? For example, if I have an object relationship of Parent > Child > Item, I could…
Andy
  • 636
  • 1
  • 6
  • 16
6
votes
2 answers

What status code should I response with when there is no data found in my database

I am wondering what status code would I response with in my else statement from the code below: if (album) { res.status(200).json({error: false, data: {channel_id: album.attributes.channel_id, id: album.id}}); } else { …
Lulzim
  • 547
  • 4
  • 9
  • 22
6
votes
1 answer

REST - Getting specific property of resources in collection only

I'm developing the search functionality of my REST API and currently URI's structured as: api/items?type=egg,potato Let's say each item resource has 4 properties: Id, Name, Type, Rating What would be the most restful way to design my URI and…
Tito
  • 832
  • 10
  • 24
6
votes
4 answers

RESTful API - URI Structure Advice

I have REST API URL structure similar to: /api/contacts GET Returns an array of contacts /api/contacts/:id GET Returns the contact with id of :id /api/contacts POST Adds a new…
Jatinder Thind
  • 202
  • 2
  • 3
  • 11
6
votes
2 answers

RESTful API subtype in URL, body or header?

I'm somewhat confused about which RESTful design is better. For the API I have three types; Question, Answer and Student. The Question type has two subtypes; MultipleChoice and Open. The Question type will possibly have more subtypes in the future.…
siebz0r
  • 18,867
  • 14
  • 64
  • 107
6
votes
6 answers

Java - Better way to parse a RESTful resource URL

I'm new to developing web services in Java (previously I've done them in PHP and Ruby). I'm writing a resource that is of the following format: /myService/// As you can see, I've got a three-level resource…
dsw88
  • 4,400
  • 8
  • 37
  • 50
6
votes
1 answer

REST Security Design good practice when exposing resources ID

On a REST based system what are the options to "encrypt" resources ID. For instance: /client/2 would be accessible at /client/SOMEHASHKEY I am thinking : 1 - Have DB tables that keeps track of a resource ID and it's corresponding HASH and look…
silkAdmin
  • 4,640
  • 10
  • 52
  • 83
5
votes
3 answers

Does Symfony2 handle restful url properly and should I use restful url?

I'm trying to figure what is the best way to design my urls. So here is what I have done so far: account_index: pattern: /Accounts/ defaults: { _controller: "CoreBundle:Account:index" } requirements: { _method: get } account_create: …
Jean-Philippe Leclerc
  • 6,713
  • 5
  • 43
  • 66
5
votes
3 answers

How to get IIS6 to recognize pathinfo routes instead of returning "404 Undescribed" error?

I am developing a RESTful web application in PHP. What I have got is: on the test server, Windows 7 / Apache 2.2 / PHP 5.2.9 (mod_php) on the production server, Windows Server 2003 / IIS6 / PHP 5.2.4 (php5isapi.dll) While the test environment has…
Paolo Stefan
  • 10,112
  • 5
  • 45
  • 64
5
votes
0 answers

Consuming RESTful pagination information from Link header RFC8288

I am interfacing with Shopify and they use RESTful API. When I request a resource that returns an array of items, they use RFC8288 pagination format. For example, https://example.com/api/inventory_levels.json?limit=10 returns 10 entities along with…
Lionet Chen
  • 832
  • 11
  • 26
5
votes
1 answer

Receiving parameters with APIView

I have this routing: url(r'^article/(?P\d+)/', views.ArticleList.as_view()) which leads to this function: class RSSList(APIView): def get(self, request, *args, **kwargs): article_id = kwargs.get('article_id') But when I…
kambi
  • 3,291
  • 10
  • 37
  • 58
5
votes
2 answers

RESTful design of convert, calculate

How to design operations like: calculate convert translate For example: convert from "EUR" to "CNY" amount "100". Is this /convert?from=EUR&to=CNY&amount=100 RESTful ?
Sodiaan
  • 341
  • 1
  • 3
  • 10
5
votes
0 answers

API Access to Tesco personal purchases in store

Is there a programmatic (read Pythonic and/or RESTful) way to access Tesco Clubcard personal history and/or through a unique receipt token, for in store purchases? It doesn't seem so from this thread on Tesco Labs and TESCO API Documentation
andrea-f
  • 1,045
  • 9
  • 23
5
votes
2 answers

Jersey log all response times for services

I have a Java application and I want to log all execution times for each REST service. How to measure execution time for each request? How the filter will be configured?
Ivan Cachicatari
  • 4,212
  • 2
  • 21
  • 41
5
votes
3 answers

Using a sub-resource or not?

Let's take the following example: We want to expose company and employee information from a RESTful API. Company data should be quite simply: GET api/v1/companies GET api/v1/companies/{id} Employees BELONG to a company, but we still want to…
Dave New
  • 38,496
  • 59
  • 215
  • 394