Questions tagged [restful-architecture]

RESTful, or representational state transfer, is a style of software architecture for distributed hypermedia systems such as the World Wide Web.

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

REST attempts to describe architectures that use HTTP or similar protocols by constraining the interface to a set of well-known, standard operations (like GET, POST, PUT, DELETE for HTTP). Here, the focus is on interacting with stateless resources, rather than messages or operations.

1187 questions
12
votes
2 answers

Create a separate app for my REST API or place it inside my working app?

I'm building simple gis system on geodjango. The app displays a set of maps and I'm also attempting to provide a RESTFUL API for these maps. I'm facing a decision whether to create a separate app for the API or to work inside my existing app. The…
12
votes
2 answers

CustomAuthorizationPolicy.Evaluate() method never fires in wcf webhttpbinding

I create a wcf service as you can see : [OperationContract] [PrincipalPermission(SecurityAction.Demand, Role = "Admin")] [WebInvoke(Method = "GET", UriTemplate = "/Data/{data}")] string GetData(string data); So I create a custom authorize as you…
Ehsan Akbar
  • 6,977
  • 19
  • 96
  • 180
12
votes
2 answers

Proper Http status codes for uploading files on rest end point

We are developing an application that allows a user to upload file on rest end point. Could someone please guide if it is correct to send 400 error code for the failure of following validation scenario: 1) The Length of file name exceeds permissible…
Tarun
  • 3,162
  • 3
  • 29
  • 45
12
votes
2 answers

DTO Design in TypeScript/Angular2

I'm currently developing an Angular 2 application. While developing I started to use TypeScript classes to create objects from JSON I receive through HTTP or when creating a new object in a form. The class may for example look like this. export…
DaSch
  • 931
  • 1
  • 5
  • 20
12
votes
4 answers

REST API for data processing and method chaining

I apologize in advance if the quality of the question is bad. I am still beginning to learn the concepts of REST API. I am trying to implement a scalable REST API for data processing. Here is what I could think of so far. Consider some numerical…
ahmohamed
  • 2,920
  • 20
  • 35
12
votes
4 answers

RESTful API: Where should I code my workflow?

I am developing a RESTful API. This is my first API, but also my first really big coding project. As such, I'm still learning a lot about architecture etc. Currently, I have my api setup in the following layers: HTTP Layer Resource Layer Domain…
GWed
  • 15,167
  • 5
  • 62
  • 99
12
votes
1 answer

Are there any best practices for exposing resource permissions/ACL to a front end via a RESTful API?

The question pretty much covers it. Given a RESTful API where we have multiple resource types and various user permissions around who can CRUD them, are there any established best practices for exposing those permissions to the front end so that the…
Jason McClellan
  • 2,931
  • 3
  • 23
  • 32
11
votes
1 answer

emailing in microservice architecture

Sorry about my english - if some thing is not clear please ask me in comments - i will clarify this. I build system in microservice architecture. I have one service with user information, one service for "offers", and one service for "ideas".…
Kamil Kiełczewski
  • 85,173
  • 29
  • 368
  • 345
11
votes
1 answer

REST API for Redshift

I'm currently brainstorming an idea and trying to figure out whether it's feasible or a better way to handle this approach. Assume I have a Redshift table and I want to expose this table through a REST API. For example, there are several customer…
11
votes
1 answer

Code Demand Constraint for RESTful APIs

As a newbie i am trying to understand REST and its principles. I have read some articles about it but struggling to undestand Code Demand Constraint which is the only optional constraint. What is it ? How and when to implement it? Any help would be…
Tartar
  • 5,149
  • 16
  • 63
  • 104
11
votes
2 answers

Apiary.io - multiple responses (200) with different parameters

I am trying to get different responses passing different parameters but something is not working. This is my API: ## Question [/questions/{question_id}] A Question object has the following attributes: + Parameters + question_id: `1` (number,…
MeV
  • 3,761
  • 11
  • 45
  • 78
11
votes
1 answer

Exposing RESTful endpoints for a one to many relationships

Consider the following relationship between two resources College has many Faculties Faculty belong to a College Obviously a Faculty is not a first class resource here. Now I need endpoints for following operations. Create a new faculty in this…
Samiron
  • 5,169
  • 2
  • 28
  • 55
11
votes
3 answers

HTTP verbs - When to use GET/POST/PUT/Delete

When you work on RESTFUL service you often hear the terms GET/POST/PUT/DELETE. My question is what is the idea behind so many verbs? I can achieve everything with the help of GET verb or if I want to post some large data in the body of the message,…
SharpCoder
  • 18,279
  • 43
  • 153
  • 249
11
votes
4 answers

Natural keys and RESTful URLs

I have a RESTful API that I'm designing which uses numeric primary keys for all of its resources. However one type of resource has a convenient natural key, which I'd like to be able to use as an optional way to specify the individual resource. For…
rectangletangle
  • 50,393
  • 94
  • 205
  • 275
11
votes
2 answers

Tree structure of data in REST - URL always from root?

Problem When the data have a tree structure of parent/child/grandchild entities, we often duplicate the information in the URL, specifying parent IDs, even if that's not necessary. What's the best way to design the RESTful API in such case? Can the…
Pavel S.
  • 11,892
  • 18
  • 75
  • 113