restful

RESTful login with devise (Rails 4)

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How do I do RESTful sign-up and sign-in using devise in Ruby on Rails (I am using version 4)? I could not find any documentation with regards to the parameters (e.g. email, password) that I should POST to the server. It seems that RESTful login using JSON data (e.g. via AJAX) is not supported out of the box in the current version of devise - the default behavior is to send back a whole HTML page for any type of request made, instead of a JSON object for handling JSON request specifically. Does this mean that I need to create/extend custom

RESTful user authentication service

匿名 (未验证) 提交于 2019-12-03 02:52:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hey folks, this seems to have been discussion fairly often but I want to make a simple, watered down question around doing authentication with RESTful services. The scenario is as follows: There is a system that houses registered users for an application. The system exposes a RESTful API for accessing these users. There is a front-end application that has a login form. The application can either be internal, or external. The front-end application needs to use the data in the User system to authenticate a user. The question now is how to

Stateless RESTful API and 3rd party authentication

匿名 (未验证) 提交于 2019-12-03 02:51:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to use 3rd party authentication (OpenID, maybe OAuth but I guess OAuth is meant for authorization ) so that user can login easily. But does authenticating on every request means I call the 3rd party (eg. Google) many times even if I don't need any thing from it? For example, I use OpenID authentication but the API I use is something internal (eg. /api/tasks/add). 回答1: Let's fix understanding issues first. OpenID and OAuth are a bit different. There is a simple way to memorize that different: OpenID is for humans. Simple example: you

Can you build a RESTful Business Logic Layer?

匿名 (未验证) 提交于 2019-12-03 02:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've built a RESTful service for the Data Access Layer (DAL) of my architecture: POST http://example.com/data/User GET|PUT|DELETE http://example.com/data/User/{UserId} However, for the Business Logic Layer (BLL), a second non-RESTful service is used: POST http://example.com/accountapi/register POST http://example.com/accountapi/login This BLL service, instead of making calls to the DAL service, it talks directly to the database. How would you improve this architecture? Should the BLL service call the DAL service ? Should I drop the DAL

AngularJS, PHP Restful Cors issue

匿名 (未验证) 提交于 2019-12-03 02:22:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have an issue trying to make an $http call to my rest php server. I'm doing cross domain calls from the client to the backend. From within my Angular app this is how the $http service is configured: .config(['$httpProvider', function($httpProvider) { $httpProvider.interceptors.push('httpResponseInterceptor'); $httpProvider.interceptors.push('httpTimeStampMarker'); $httpProvider.defaults.useXDomain = true; $httpProvider.defaults.headers.post['Access-Control-Allow-Origin'] = '*'; $httpProvider.defaults.headers.post['Content-Type'] =

AngularJS $resource RESTful example

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to use $resource to call my RESTful web service, (which I am still working on) but I would like to find out if I got my AngularJS script correct first. The todo DTO has: {id, order, content, done} :cmd is so I can call api/1/todo/reset to clear the todo table in database. Here is the code with comment of my understanding: function TodoService($resource) { var src = $resource('api/1/todo/:id:cmd', {id: "@id", cmd: "@cmd"}, //parameters default { ListTodos: { method: "GET", params: {} }, GetTodo: { method: "GET", params: { id: 0 }

OPTIONS request for restful cross-domain using CORS

匿名 (未验证) 提交于 2019-12-03 02:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: On client side I'm using Ajax.post (jquery 1.5) with json. On server side I'm using rest resteasy-jaxrs-2.0.1.GA. I found somewhere that i should add couple of headers to server response and I've done with following filter: public void doFilter( ServletRequest req, ServletResponse res, FilterChain filterChain) throws IOException, ServletException { MyServletRequestWrapper httpReq = new MyServletRequestWrapper((HttpServletRequest)req); HttpServletResponse httpRes = (HttpServletResponse)res; HttpSession session = httpReq.getSession(); httpRes

Parse Fitnesse RESTFul XML output into TFS Test format

匿名 (未验证) 提交于 2019-12-03 01:59:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm integrating a Fitnesse Acceptance test suite into a TFS based CI process. I can run the Fitnesse Test suite in a RESTful manner ( http://fitnesse.org/FitNesse.UserGuide.RestfulTests ): http://myfitnesseserver/MyTestSuite?suite&format=xml and get back an XML document of test results. I'd like to transform that into a format that TFS can interpret as number of tests passed / failed. Any pointers? Thanks 回答1: I have a similar goal at work, so I created a generic command-line Fitnesse test runner that executes a test or suite as a web

Yii2 Restful API - Example to Add a New Action

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: For buiding restful API using Yii2, does anyone has good example on how to add a new action in a controller? Thanks. 回答1: I am not sure if you are asking for extra actions beside CRUD or just for CRUD, so I write in details for both cases. Firstly, the framework includes \yii\rest\ActiveController that provides typical restful API operation and URL management. Basically, the controller predefines the CRUD operations as followed: POST /resource -> actionCreate -> Create the resource GET /resource/{id} -> actionView -> Read the resource PUT,

How to design a RESTful collection resource?

匿名 (未验证) 提交于 2019-12-03 01:58:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to design a "collection of items" resource. I need to support the following operations: Create the collection Remove the collection Add a single item to the collection Add multiple items to the collection Remove a single item from the collection Remove multiple items from the collection This is as far as I have gone: Create collection: ==> POST /service Host: www.myserver.com Content-Type: application/xml Remove collection: ==> DELETE /service/items Removing a single item from the collection: ==> DELETE /service/items/item1