restful-architecture

How to handle huge data from a REST service

廉价感情. 提交于 2019-12-22 05:19:34
问题 We are using a REST service that returns huge data. In production, the server hardware can handle it. I need to test the REST service by getting the data on my local machine, which cannot handle the huge data. My local machine is a 4G i5. I am getting out of memory exception every time I hit the service. response.getStatus() returns 200 status. But while collecting the data using input stream reader, I get an out of memory exception. BufferedReader br = new BufferedReader(new

ASP.NET MVC RESTFul architecture

时光怂恿深爱的人放手 提交于 2019-12-22 00:06:37
问题 Does ASP.NET MVC support RESTful architecture by default? What I want to know is, if I want to develop a RESTful kind of project, need I to specially work anything on ASP.NET MVC or it will support this feature by default? 回答1: If you use Controllers to represent resources and simply implement "actions" that are equal to the HTTP methods, then you can produce a RESTful system very easily with ASP.NET MVC. 回答2: MVC has been created with REST in mind. It is REST-friendly but not 100% REST

Can a RESTful service return both JSON and XML for the same resource, depending on the request header?

人走茶凉 提交于 2019-12-21 20:18:15
问题 I have a simple RESTful method which currently returns JSON representation of an object. My question is more of from the architectural perspective and not completely technical. Should a RESTful service be designed in such a way that it returns both JSON and XML at the same time? As far as I know this is a bad practice and separate resources should be defined for this. One resource should return JSON data and other one XML. Am I thinking it correctly? 回答1: The same resource may return either

What is “representation”, “state” and “transfer” in Representational State Transfer (REST)?

北战南征 提交于 2019-12-21 17:49:06
问题 I came across a few resources regarding REST but I'm not able to understand things clearly. It would help me if someone could explain things with respect to my example below. I have a table named User User table Content id name 1 xxx The URL I will be calling is /test/1 The result will be in JSON format, eg: { 1: "xxx" } My understanding so far regarding REST: Resource - User table content Representation - table/JSON State transfer - data in the form of table to JSON. Please do let me know if

RESTful API: Where should I code my workflow?

↘锁芯ラ 提交于 2019-12-20 12:15:56
问题 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 Model / Business Logic Layer Data Access / Repository Layer Persistent Storage / DB Layer The issue I have run into at the moment is where do I need to put workflow objects / managers? By workflows, I mean code that evaluates what next step is required

Should a RESTful GET response return a resource's ID?

*爱你&永不变心* 提交于 2019-12-20 09:15:26
问题 A number of the developers here are having a friendly (some would say religious) discussion about whether a GET request from a RESTful API should return the ID of the requested resource . Let's assume the following GET request: http://my.api.com/rest/users/23 This currently returns: {"name": "Jim", "age": 40, "favoriteColor": "blue"} Note that "id" is missing from the result set. There are basically 4 camps battling with this issue. CAMP #1: When callers make the GET request, they already

RESTful API URI Design

隐身守侯 提交于 2019-12-20 09:06:57
问题 I'm looking for some direction in regards to the URI design for a RESTful API. I'm going to have several nested linked resources and have currently designed my URI's similar to this post: Hierarchical RESTful URL design The following example isn't what I'm building but I think illustrates my situation well. (Assume that a show can only belong to one network). /networks [GET,POST] /networks/{network_id} [GET,PUT] /networks/{network_id}/shows [GET,POST] /networks/{network_id}/shows/{show_id}

Different REST resource content based on user viewing privileges

左心房为你撑大大i 提交于 2019-12-20 08:41:29
问题 I want to provide different answers to the same question for different users, based on the access rights. I read this question: Excluding private data in RESTful response But I don't agree with the accepted answer, which states that you should provide both /people.xml and /unauthenticated/people.xml , since my understanding of REST is that a particular resource should live in a particular location, not several depending on how much of its information you're interested in. The system I'm

How to combine websockets and http to create a REST API that keeps data up to date? [closed]

喜夏-厌秋 提交于 2019-12-20 08:24:12
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . I am thinking about buildning a REST API with both websockets and http where I use websockets to tell the client that new data is available or provide the new data to the client directly. Here are some different ideas of how it could work: ws = websocket Idea A: David get all

Is it okay to use same resource name for both get and post rest api

江枫思渺然 提交于 2019-12-19 05:35:16
问题 Sometime back I developed a Restful service in Java with only 1 GET resource. It was accessed like this: GET http://localhost:8080/my-project/customers/transactions This GET request returns all the customer transactions. Now, I have another project request where they want to insert customer transactions in a different schema in same database. I thought instead of creating other service I could enhance this service since underlying database is same and it's about customer transactions. So, I