Search Results

Search found 752 results on 31 pages for 'restful'.

Page 11/31 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Network ActiveRecord relation with Rails

    - by Zag zag..
    Hi, I have a has and belongs to many relation between User and Article models, and I would like to link them even if an article if not hosted on the same database then a user. For example, If an article exists at foo.com/articles/3 and a user exists at bar.com/users/1, If would like to be able to do from foo.com web interface or bar.com web interface this kind of query: a_user.articles (or an_article.users). I think this can be possible adding a field like "url" in users and articles tables. But I don't know how to process for ActiveRecord. My Article model looks like this: class Article < ActiveRecord::Base has_and_belongs_to_many :users end Is there yet some example of project using this kind of relation over internet? Many thanks

    Read the article

  • REST design: what verb and resource name to use for a filtering service

    - by kabaros
    I am developing a cleanup/filtering service that has a method that receives a list of objects serialized in xml, and apply some filtering rules to return a subset of those objects. In a REST-ful service, what verb shall I use for such a method? I thought that GET is a natural choice, but I have to put the serialized XML in the body of the request which works but feels incorrect. The other verbs don't seem to fit semantically. What is a good way to define that Service interface? Naming the resource /Cleanup or /Filter seems weird mainly because in the examples I see online, it is always a name rather than a verb being used for resource name. Am I right to feel that REST services are better suited for CRUD operations and you start bending the rules in situations like this service? If yes, am I then making a wrong architectural choice. I've pushed to develop this service in REST-ful style (as opposed to SOAP) for simplicity, but such awkward cases happen a lot and make me feel like I am missing something. Either choosing REST where it shouldn't be used or may be over-thinking some stuff that doesn't really matter? In that case, what really matters?

    Read the article

  • Specing remember_me feature in rails + restful_authentication

    - by Thiago
    Hi there, I want to run a the following example in cucumber: Scenario: Anonymous user can log in and be remembered Given I am logged in with reminder When I navigate away And I go to the list of cornetas Then I should be logged in But I don't know how to write the "And I navigate away" step. I already tried to "visit stackoverflow.com" or "visit http://stackoverflow.com", but with no success. Any suggestions? I guess I could also destroy the webrat session, but I don't know how to do it, neither if it would work.

    Read the article

  • Are these REST HTTP response codes right, and what about the Content-Type?

    - by talentedmrjones
    I'm writing a controller helper that sets the proper response headers for my REST controller action. It's pasted below and should be simplified enough for those who aren't familiar with Zend Framework to understand what I'm doing. My question is: Are these codes correct for their respective responses, and in the case of "access denied" do I use a 401 or 403? Also, in case of responding with an error, I understand I should be placing a message in the response body, but should I set the "Content-Type" to "text/plain"? <?php class App_Controller_Helper_RestResponse extends Zend_Controller_Action_Helper_Abstract { public function denied() { // 403 or 401? } public function notFound() { // 404 } public function created() { // 201 } public function deleted() { // 204 } public function redirect() { // 301 // new url } public function malformed() { // 400 } public function gone() { // 410 } }

    Read the article

  • Sorting page flow for has_many in Rails

    - by Gareth
    I have a page flow allowing the user to choose an object ("Player") to add to a has_many :players association in another model. 1 => List existing players for object [Enter player name] 2 => List of matching players [Select player] 3 => Confirmation page [Press 'Add'] 4 => Done I want users to be able to choose "New Player" instead of selecting a player at step 2, in which case the user will go through the standard New Player process elsewhere on the site. However, after that's done, the user should return to step 3 with the new player in place. I don't know what the best way is to implement this. I don't want to duplicate the player creation code, but I don't want to dirty up the player creation code too much just for this case. I also don't want to start sticking IDs in the session if I can help it. It's fine in simple cases but if the user ever has two windows/tabs then things start behaving badly. What do you think?

    Read the article

  • Unwanted redirection after authentication

    - by jodaha
    Hello world! We have a form to submit ratings for a certain restaurant in a in our views/restaurants/show.html.erb. We only want logged in users to create new ratings. We put before_filter :login_required, :only = [ :new, :create ] (but we also tried only ":create") on top of our RatingsController. If we click the submit button after typing in the rating details we are prompted to log in (which is what we want). After filling in username and password and submitting the login form we get redirected back to e. g. /restaurants/36/ratings, but we want to be redirected back to where we came from - e. g. /restaurants/36/. We tried redirect_to(:back), but this redirects us back to the login form. Also the new rating does not get saved to the database. Any idea how we can change the redirection and how to make sure the rating gets saved? Thanks!

    Read the article

  • Tab Sweep: Logging, WebSocket, NoSQL, Vaadin, RESTful, Task Scheduling, Environment Entries, ...

    - by arungupta
    Recent Tips and News on Java, Java EE 6, GlassFish & more : • Detailed Logging Output with GlassFish Server, Hibernate, and Log4j (wikis.oracle.com) • Serving Static Content on WebLogic and GlassFish (Colm Divilly) • Java EE and communication between applications (Martin Crosnier) • What are the new features in Java EE 6? (jguru) • Standardizing JPA for NoSQL: are we there yet? (Emmanuel) • Create an Asynchronous JAX-WS Web Service and call it from Oracle BPEL 11g (Bob) • Programmatic Login to Vaadin application with JAAS utilizing JavaEE6 features and Spring injection (vaadin) • Is in an EJB injected EntityManager thread-safe? (Adam Bien) • Websocket using Glassfish (demj33) • Designing and Testing RESTful web services [ UML, REST CLIENT ] (Mamadou Lamine Ba) • Glassfish hosting -Revion.com Glassfish Oracle hosting (revion.com) • Task Scheduling in Java EE 6 on GlassFish using the Timer Service (Micha Kops) • JEE 6 Environmental Enterprise Entries and Glassfish (Slim Ouertani) • Top 10 Causes of Java EE Enterprise Performance Problems (Pierre - Hugues Charbonneau)

    Read the article

  • How to Integrate Backbone.js with RESTful Web Services in 5 Minutes!

    - by Geertjan
    In NetBeans IDE 7.3, a Backbone.js file can be generated from a Java RESTful web service. The Backbone.js file contains complete CRUD functionality and your HTML5 application can immediately be deployed to make use of those features. Coupled with the NetBeans IDE two-way editing support for HTML5, via interaction with WebKit in Chrome, Backbone.js users have a completely new and powerful tool for coding their HTML5 applications. The above is illustrated via the brand new YouTube movie below: This makes NetBeans IDE 7.3 well suited as a learning tool for new Backbone.js users, as well as a productivity tool for those who are comfortable with Backbone.js already.

    Read the article

  • JavaOne 2012 : Oracle sort la Preview de NetBeans 7.3 et dévoile Easel, une extension pour la création des clients RESTful JavaScript

    JavaOne 2012 : Oracle sort la Preview de NetBeans 7.3 et dévoile le projet Easel une extension pour la création des clients RESTful à base de JavaScript JavaOne 2012 bat son plein. Le Masonic Auditorium de San Francisco vibre aux couleurs de l'écosystème Java qui est en train d'être disséqué par les experts de l'industrie. Lors de la session consacrée à NetBeans, l'environnement de développement intégré open source pour Java, PHP, C et C++, Oracle a annoncé la sortie de la preview de NetBeans 7.3, la prochaine mise à jour majeure de l'EDI. [IMG]http://ftp-developpez.com/gordon-fowler/NetBeans%20Logo.png[/IMG] Le futur standard du We...

    Read the article

  • What is the preferred Internet media type of a RESTful POST request?

    - by rdasxy
    Is there a preferred/recommended Internet Media Type for RESTful POST requests? For example, if I want to add a new user, should I send the data as a URL encoded string like: name=Foo&otherData=Bar or does REST recommend I send the data as whatever format the response is going to be sent as (e.g. JSON/XML)? <user> <name>Foo</name> <other-data>Bar</other-data> </user>

    Read the article

  • Restful Java based web services in json + html5 and javascript no templates (jsp/jsf/freemarker) aka fat/thick client

    - by Ismail Marmoush
    I have this idea of building a website which service JSON data through restful services framework. And will not use any template engines like jsp/jsf/freemarker. Just pure html5 and Javascript libs. What do you think of the pros and cons of such design ? Just for elaboration and brain storming a friend of mine argued with the following concerns: sounds like gwt this way you won't have any control over you service api for example say you wanna charge the user per request how will you handle it? how will you control your design and themes? what about the 1st request the browser make? not easy with this all of the user's requests will come with "Accept" header "application/json" how will you separate browser from abuser? this way all of your public apis will be used by third party apps abusively and you won't be able to lock it since you won't be able to block the normal user browser We won't use compiled html anyway but may be something like freemarker and in that case you won't expose any of your json resources to the unauthorized user but you will expose all the html since any browser can access them all the well known 1st class services do this can you send me links to what you've read? keep in mind the DOM based XSS it will be a nightmare ofc, if what you say is applicable.

    Read the article

  • How to handle fine grained field-based ACL permissions in a RESTful service?

    - by Jason McClellan
    I've been trying to design a RESTful API and have had most of my questions answered, but there is one aspect of permissions that I'm struggling with. Different roles may have different permissions and different representations of a resource. For example, an Admin or the user himself may see more fields in his own User representation vs another less-privileged user. This is achieved simply by changing the representation on the backend, ie: deciding whether or not to include those fields. Additionally, some actions may be taken on a resource by some users and not by others. This is achieved by deciding whether or not to include those action items as links, eg: edit and delete links. A user who does not have edit permissions will not have an edit link. That covers nearly all of my permission use cases, but there is one that I've not quite figured out. There are some scenarios whereby for a given representation of an object, all fields are visible for two or more roles, but only a subset of those roles my edit certain fields. An example: { "person": { "id": 1, "name": "Bob", "age": 25, "occupation": "software developer", "phone": "555-555-5555", "description": "Could use some sunlight.." } } Given 3 users: an Admin, a regular User, and Bob himself (also a regular User), I need to be able to convey to the front end that: Admins may edit all fields, Bob himself may edit all fields, but a regular User, while they can view all fields, can only edit the description field. I certainly don't want the client to have to make the determination (or even, for that matter, to have any notion of the roles involved) but I do need a way for the backend to convey to the client which fields are editable. I can't simply use a combination of representation (the fields returned for viewing) and links (whether or not an edit link is availble) in this scenario since it's more finely grained. Has anyone solved this elegantly without adding the logic directly to the client?

    Read the article

  • How do I secure password parameters in RESTful web service URIs?

    - by adam
    i'm a newbie to server-side programming, so please forgive me if this gets messy. i've been contracted to create a web service to allow authenticated users to access a database. users have to enter a login and password. been reading and reading about REST vs SOAP, and i thought i'd settled on a RESTful design when i came across this statement: "Data that needs to be secure should not be sent as parameters in URIs." this seems like a major demerit against a RESTful approach. i'm aware that with https the password would be encrypted to prevent man-in-the-middle interception, but that leaves the server logs and client history as possible exposure points. is there a RESTful solution out there for this problem, or do i need to go SOAPy? any advice appreciated.

    Read the article

  • Why can't i create a RESTful web service in ejb module?

    - by Nitesh Panchal
    Hello, I am using Netbeans 6.8. I can see an option to create a web service in my independent ejb module but i can't seem to find an option to create a RESTful based web service in my ejb module. Is there any kind of restriction in ejb module that i can only create SOAP based web service and not RESTful? or is it the bug of Netbeans 6.8?

    Read the article

  • Does WCF make the consumption of Restful web services trivial?

    - by Steve Weet
    I have an ASP.net application that currently consumes SOAP web services. This platform is targeted at .net 2.0 and I use Visual Studio Professional 2005 to maintain it. I now have a requirement to consume a number of restful web service within the same application. Is the consumption of Restful web services with WCF so trivial, compared to using HttpClient that it is worth the cost and time of upgrading to Visual Studio 2008 and .Net 3.5 framework

    Read the article

  • How to map different UI views in a RESTful web application?

    - by MicE
    Hello, I'm designing a web application, which will support both standard UIs (accessed via browsers) and a RESTful API (an XML/JSON-based web service). User agents will be able to differentiate between these by using different values in the Accept HTTP header. The RESTful API will use the following URI structure (example for an "article" resource): GET /article/ - gets a list of articles POST /article/ - adds a new article PUT /article/{id} - updates an existing article based on {id} DELETE /article/{id} - deletes an existing article based on {id} The UI part of the application will however need to support multiple views, for example: a standard resource view a view for submitting a new resource a view for editing an existing resource a view for deleting an existing resource (i.e. display delete confirmation) Note that the latter three views are still accessed via GET, even though they are processed via overloaded POST. Possible solution: Introduce additional parameters (keywords) into URIs which would identify individual views - i.e. on top of the above, the application would support the following URIs (but only for Content-Type: text/html): GET /article/add - displays a form for adding a new article (fetched via GET, processed via POST) GET /article/123 - displays article 123 in "view" mode (fetched via GET) GET /article/123/edit - displays article 123 in "edit" mode (fetched via GET, processed via PUT overloaded as POST) GET /article/123/delete - displays "delete" confirmation for article 123 (fetched via GET, processed via DELETE overloaded as POST) A better implementation of the above might be to put the add/edit/delete keywords into a GET parameter - since they do not change the resource we're working with, it might be better to keep the base URI same for all of them. My question is: How would you map the above URI structure to UIs served to the regular user, considering that there can be several views per each resource, please? Do you agree with the possible solution detailed above, or would you recommend a different approach based on your experience? NB: we've already implemented an application which consists of a standalone RESTful API and a standalone web application. I'm currently looking into options for future projects where these two would be merged together (i.e. in order to reduce overhead). Thank you, M.

    Read the article

  • What URL scheme would be better for "nested" resources in a RESTful application?

    - by Luke404
    Let's say we want a RESTful web service to manage some logically nested resources, where each instance of resource 'B' is logically contained by an instance of resource 'A'. The first example that comes to mind, working as a sysadmin, is email accounts and their domains: [email protected] [email protected] [email protected] ... What URL scheme would you suggest? At first I'd try: /domain/[domainname] /domain/[domainname]/account/[accountname] is that in line with RESTful principles? or should I go with something like: /domain/[domainname] /account/[account@domainname]/ or anything else?

    Read the article

  • RESTful web services - best way to return result of an operation?

    - by saille
    I am designing a RESTful API and I would like to know what the most RESTful way is to return details about an operation. E.g. an operation on a resource occurs when some data is POSTed to a URL. HTTP status codes will indicate either success or failure for the operation. But apart from success/failure I need to indicate some other info to the client, such as an ID number. So my question is, should the ID number be returned in an XML document in the response content, or should it be returned in some custom HTTP header fields? Which is more in line with the principles of REST? Or am I free to choose.

    Read the article

  • Generating PDF's via Delayed Job while maintaing a RESTful pattern.

    - by Jeff
    Hi, currently I am running a Rails app on Heroku, and everything is working great with exception of generating PDF documents that sometimes contain thousands of records. Heroku has a built-in timeout of 30 seconds, so if the request takes more than 30 seconds, it's abandoned. That's fine, since they offer delayed_job support built-in. However, all of the PDF's i generate follow a typical restful pattern. For instance, a request to "/posts.pdf" generates a pdf (using PRAWN and PRAWNTO) and it's delivered to the browser. So my basic question is, how do I create dynamically generated PDF's with delayed_job while maintaining the basic RESTful patterns Rail's so conveniently provides. Thanks.

    Read the article

  • How do I Benchmark RESTful Service with Variable Parameters?

    - by Eli
    I'm currently working on benchmarking a RESTful service I've made, and part of that is making sure it runs in a reasonable amount of times for a large array of parameters. For example, let's say I have RESTful API of the form some_site.com/item?item_id=y. In that case to be sure my service is working as fast as I'd like it to work, I'd want to try out many values for y one by one, preferably coming from some text file. I can't figure out any way of doing this in ab or httperf. I'm open to using a different benchmarking program if I have, but would prefer something simple and light. What I want to do seems like something pretty standard, so I'm guessing there must already be a program that let's me do it, but an hour or so of googling hasn't gotten me an answer. Ideas?

    Read the article

  • Should I separate RESTful API controllers from "regular" controllers?

    - by keithjgrant
    This seems like an elementary question, but after a lot of searching around I can't seem to find a straightforward explanation: If I'm building a web application that is going to be accessed largely through a web browser, but that will also support some API requests in a RESTful way, should there be a large degree of separation between the two? On one hand, it seems a large amount of the functionality is the same, with identical data presented in different views (HTML vs. XML/JSON). But on the other hand, there are certain things I need to present to the browser that doesn't quite fit a RESTful approach: how to get an empty form to create a new instance of a resource and how to get a pre-populated form to edit an existing resource. Should these two different methods of accessing the system by funneled through different controllers? Different methods in the same controller? The exact same methods with a switch for view type?

    Read the article

  • How to parse the multipart data in a restful service...

    - by AXS
    I have written a restful web service in c# and .net using the Restful Starter Kit that receives a mime multipart form via a stream. The multipart form contains a small xml fragment and a small file binary. I have read the stream in, and I have also written some code to parse the data to obtain the XML and the file binary. However, I feel that there should be some methods already written in the .net classes to allow me to access the two parts of the multipart form without having to parse the data myself. Does anyone have any ideas on how to do this?

    Read the article

  • (Rails) How do I reference resources from non-restful views...?

    - by humble_coder
    Hi All, How do you ensure that your javascript includes get included properly for all files everywhere using a particular layout? Basically I have some non-restful actions that I've added. I haven't added any ROUTES for them, however, using normal text rendering works fine. It's when I start requiring different "swf" and "js" files (files which are properly placed in PUBLIC) that things get hairy. I start receiving "406 Not Acceptable" errors telling me that it's looking for the files in a subdirectory of the current controller. As it stands I'm in including the JS in "application" layout file. It works for the INDEX action, but doesn't seem to work for any of the non-restful actions. Thoughts?

    Read the article

  • RESTful enums. string or Id?

    - by GazTheDestroyer
    I have a RESTful service that exposes enums. Should I expose them as localised strings, or plain integers? My leaning is toward integers for easy conversion at the service end, but in that case the client needs to grab a list of localised strings from somewhere in order to know what the enums mean. Am I just creating extra steps for nothing? There seems to be little information I can find about which is commonly done in RESTful APIs. EDIT: OK. Let's say I'm writing a website that stores information about people's pets. I could have an AnimalType enum 0 Dog 1 Cat 2 Rabbit etc. When people grab a particular pet resource, say /pets/1, I can either provide a meaningful localised string for the animal type, or just provide the ID and force them to do another look up via a /pets/types resource. Or should I provide both?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >