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
4
votes
2 answers

What's the "right" way to create a many-to-many relationship in a Restful API

I try to find the best practice in order to create a Many-to-Many relationship in a Restful API. The usecase is really simple, but i cannot really found the "right" way to do it. In our model, we have Kid that are related with a Many-to-Many…
4
votes
1 answer

What's a RESTful way to query with logic operation?

This is a spin-off question to query with filters Say my application is managing objects called workload, with the following fields. I want to expose a REST interface for user to query workloads by labels. "Workload": {"id":"test1", "labels":["A",…
cookieisaac
  • 1,357
  • 5
  • 18
  • 35
4
votes
4 answers

REST API sub resources, data to return?

If we have customers and orders, I'm looking for the correct RESTful way to get this data: { "customer": { "id": 123, "name": "Jim Bloggs" "orders": [ { "id": 123, "item": "Union Jack Keyring", "qty": 1 …
Stephen Last
  • 5,491
  • 9
  • 44
  • 85
4
votes
0 answers

Best design practice to implement routes and controllers for a RESTFul Laravel app

I am developing an application with Laravel 5.2, it has to be implemented RESTFUL. It is also very easy to implement RESTful resources in Laravel. for example for getting all categories in json format in routes we just have to add…
Siavosh
  • 2,314
  • 4
  • 26
  • 50
4
votes
1 answer

Required request body is missing

I am new at Spring and Rest. I wrote a simple rest like this: @RequestMapping(value = "/loginTest", method = RequestMethod.POST) @ResponseBody public Response loginTest(@RequestBody LoginRequest request) { System.out.println("enter…
Damon
  • 41
  • 1
  • 1
  • 2
4
votes
1 answer

Can node js make a restful service call

Is it possible for a node js application to make a call to another web application on Tomcat with a restful service call? Regards
oxygenan
  • 1,023
  • 2
  • 12
  • 21
4
votes
2 answers

how to Restfully implement joins via a query string

Our stack currently uses mongoose as a ODBM and I was wondering how exactly I should implement a RESTFUL request to determine whether a foregin key gets populated(i.e the forgeign key _id property gets replaced with the either the entire document or…
Austin Davis
  • 3,516
  • 10
  • 27
  • 47
4
votes
1 answer

Rails Tutorial 7.4.4 - How does post method submit form with authenticity token?

I'm at Rails Tutorial 7.4.4 and I'm curious about how the post_via_redirect method in the following test post form along with authenticity_token parameter. The following test would pass: class UsersSignupTest < ActionDispatch::IntegrationTest …
Godric Cao
  • 43
  • 3
4
votes
0 answers

About Listing NSURLCache url and deleting item cache

I working on a RestFull api and i would like to test some powerful thing. To avoid always calling the server i cache some return data with NSURLRequestReturnCacheDataElseLoad. I delete my cache with [[NSURLCache sharedURLCache]…
Armanoide
  • 1,248
  • 15
  • 31
4
votes
1 answer

Struts2 better URLs with dot inside

Let's say we need to get a login form with pre-defined username. So if user goes to url: //somehost:8080/myapp/auth/myusername the action should take myusername as input parameter. I tried http://www.struts2.info/blog/better-urls-with-struts2 as…
never
  • 671
  • 1
  • 6
  • 18
4
votes
1 answer

REST - dealing with sub-resource access

I'm evaluating a possible REST API design and would like to ask for feedback or best practices on ways of dealing with nested resources. Consider the following (JSON expressed) data model of a contrived book library that is analogous to the data I'm…
void4
  • 206
  • 1
  • 4
  • 10
4
votes
3 answers

RESTful URL design: public vs private API, hierhachy API design pattern, URI vs URL design?

I often get into issue like this, very similar to this Hierarchical RESTful URL design Supposed the service only offers the user to upload a document. POST, GET /accounts PUT, DELETE /accounts/{name} or /accounts/{id} Now a document is attached to…
CppLearner
  • 16,273
  • 32
  • 108
  • 163
4
votes
2 answers

Managing versions in web API

So most restful services it seems have version whether it be in the URL, headers, or what have you, now how do you manage these routes on the server side? The real question is how do you take the request and and make sure it gets pointed to the…
dbarnes
  • 1,803
  • 3
  • 17
  • 31
4
votes
1 answer

Laravel 4: how to write the correct nested controller for nested resource?

In Laravel 4, I wish to create a set of restful resources as follows: http://localhost/posts/1/comments http://localhost/posts/1/comments/1 http://localhost/posts/1/comments/1/edit ... So I created two controllers: PostsController and…
JackpotK
  • 313
  • 1
  • 8
  • 18
4
votes
3 answers

How to "lazy load" in a RESTful manner?

Given this service to get information about a hotel: > GET /hotel/{id} < HTTP/1.1 200 OK < < aaa < aaa > aaa....I am 300K < Problem is that biggie is 300K and we don't want to return it with…
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429