restful-architecture

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

核能气质少年 提交于 2019-12-19 05:35:10
问题 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

MailChimp API 3.0 batch/bulk subscribe

半世苍凉 提交于 2019-12-19 04:42:45
问题 For MailChimp API 2.0 there was a method 'batch-subscribe', to send in an array of email addresses to be added to a specific list in MailChimp. How to implement this in the new Rest Architecture based MailChimp API 3.0? See https://github.com/mailchimp/APIv3-examples/wiki/Overview It says it would work with array of objects But by the schema it only accepts an object Schema https://us9.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json 回答1: The page you're linking to look like docs

MailChimp API 3.0 batch/bulk subscribe

时间秒杀一切 提交于 2019-12-19 04:42:13
问题 For MailChimp API 2.0 there was a method 'batch-subscribe', to send in an array of email addresses to be added to a specific list in MailChimp. How to implement this in the new Rest Architecture based MailChimp API 3.0? See https://github.com/mailchimp/APIv3-examples/wiki/Overview It says it would work with array of objects But by the schema it only accepts an object Schema https://us9.api.mailchimp.com/schema/3.0/Lists/Members/Collection.json 回答1: The page you're linking to look like docs

How can I make Laravel return a custom error for a JSON REST API

五迷三道 提交于 2019-12-18 10:33:26
问题 I'm developing some kind of RESTful API. When some error occurs, I throw an App::abort($code, $message) error. The problem is: I want him to throw a json formed array with keys "code" and "message", each one containing the above mentioned data. Array ( [code] => 401 [message] => "Invalid User" ) Does any one knows if it's possible, and if it is, how I do it? 回答1: go to your app/start/global.php . This will convert all errors for 401 and 404 to a custom json error instead of the Whoops

Razor templates, views and angular.js

こ雲淡風輕ζ 提交于 2019-12-18 10:30:55
问题 TL;DR What are the best practices when using .NET Razor views and AngularJS? Context We are developing a public website (not an intranet application) using mvc4 with razor, and we weren't very familiar with client script, so we started with what we knew: jQuery. But now things are getting more complicated and we'd like to switch to AngularJS. On the .NET part, we use Razor templates and UIHintAttribute (plus some custom ones) to render the right html "control". We also add custom html

Razor templates, views and angular.js

前提是你 提交于 2019-12-18 10:30:06
问题 TL;DR What are the best practices when using .NET Razor views and AngularJS? Context We are developing a public website (not an intranet application) using mvc4 with razor, and we weren't very familiar with client script, so we started with what we knew: jQuery. But now things are getting more complicated and we'd like to switch to AngularJS. On the .NET part, we use Razor templates and UIHintAttribute (plus some custom ones) to render the right html "control". We also add custom html

In what do consist the misunderstandings about the “REST” word and its meaning

谁都会走 提交于 2019-12-17 23:23:00
问题 It is not always easy to figure what is really a RESTFull application and/or api, because there is a sort of misunderstanding about the REpresentational State Transfer architectural style meaning and scopes. Initially, I was quite in trouble on what, the adjective "REpresentational" of the acronym REST, referred. This was because "representational state" sounded to me not so well.. Further, I was impressed also by a blog post of the author of this architectural style, Roy Fielding, where he

In a RESTful web service, is it acceptable for the server to take many minutes to respond?

血红的双手。 提交于 2019-12-13 19:14:30
问题 I am developing a RESTful web service using flask-restful. The client needs to be able to request a job to be performed by the server. This job can take anywhere from ~1 second to ~1 hour to perform. Generally, it is expected to take 1-5 minutes. When the job is complete, the client needs to download a JSON dump. Anywhere from 100KB to 100MB in size. I see 2 options: The client submits the job as a POST request, and the response from the server only comes when the job is complete. The

Validate/Change Password via REST API

此生再无相见时 提交于 2019-12-13 13:12:24
问题 I want to change a user password via a REST API. This is not a forgotten or reset password function, but a logged in user wanting to change their password. The form requires the current password, the new password, and a confirmation for the new password. However, I want to validate each form field as the user fills it out. This is trivial for newPassword and confirmNewPassword (client side), but not for currentPassword . Currently performing update to the User object via PUT /users/:id . If a

Designing a RESTful website [closed]

£可爱£侵袭症+ 提交于 2019-12-13 12:42:19
问题 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 5 years ago . I am trying to learn to create RESTful web applications. I have a few doubts. Say, I have a requirement to display the name of user on the website header. I used to do it by storing the user object in session and then fetching the name in the JSP. But now, isn't that storing