Search Results

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

Page 21/31 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Django CSRF framework cannot be disabled and is breaking my site

    - by MikeN
    The django csrf middleware can't be disabled. I've commented it out from my Middleware of my project but my logins are failing due to missing CSRF issues. I'm working from the Django trunk. How can CSRF cause issues if it is not enabled in middleware? I have to disable it because there are lots of POST requests on my site that CSRF just breaks. Any feedback on how I can completely disable CSRF in a django trunk project? The "new' CSRF framework from Django's trunk is also breaking an external site that is coming in and doing a POST on a URL I'm giving them (this is part of a restful API.) I can't disable the CSRF framework as I said earlier, how can I fix this?

    Read the article

  • Object mapping in objective-c (iphone) from JSON

    - by freshfunk
    For my iPhone app, I'm consuming a RESTful service and getting JSON. I've found libraries to deserialize this into an NSDictionary. However, I'm wondering if there are any libraries to deserialize the JSON/NSDictionary/Property List into my object (an arbitrary one on my side). The java equivalent would be the object-relational mappers although the sort of object mapping I'm looking for is relatively straightforward (simple data types, no complex relationships, etc.). I noticed that Objective-C does have introspection so it seems theoretically possible but I haven't found a library to do it. Or is there a simple way to load an object from an NSDictionary/Property List object that doesn't require modification every time the object changes? For example: { "id" : "user1", "name" : "mister foobar" "age" : 20 } gets loaded into object @interface User : NSObject { NSString *id; NSString *name; int *age; }

    Read the article

  • Calling WCF Service from Action Script 2

    - by Frank
    Hi All, I am a .NET programmer working with a Flash designer on a project. The design is that they will create a flash UI (implemented with AS2) to present a questionnaire. After it is completed by an end user, the will send me (a .net web service of some form) the answers to the questionnaire, I will perform a calculation, and I will send a response back (the response will likely be a single integer, though it may be a touple of (integer score, string description). Neither myself nor the designer is knowledgeable of Action Script. Does anyone have a snippet for such web service calls in AS2? Are there any soap libraries for AS2 that we could use, or should I expose a RESTful interface? Can it be as simple as having the designer concat the questionnaire answers into the query string of the service URL? What would be a typical data format for my response (xml, json, plain text) Thanks in advance for your help. Frank

    Read the article

  • Spring MVC Controller redirect using URL parameters instead of in response.

    - by predhme
    I am trying to implement RESTful urls in my Spring MVC application. All is well except for handling form submissions. I need to redirect either back to the original form or to a "success" page. @Controller @RequestMapping("/form") public class MyController { @RequestMapping(method = RequestMethod.GET) public String setupForm() { // do my stuff return "myform"; } @RequestMapping(method = RequestMethod.POST) public String processForm(ModelMap model) { // process form data model.addAttribute("notification", "Successfully did it!"); return "redirect:/form"; } } However as I read in the Spring documentation, if you redirect any parameters will be put into the url. And that doesn't work for me. What would be the most graceful way around this?

    Read the article

  • django + ExtJs - list of example implementations with source code

    - by Tom Tom
    Hi, I want to learn ExtJs http://www.extjs.com/ in combination with Django (I know Django already .. a bit ;-) and I'm on the search of examples I can learn from. I found already this post. Would be great if you post your links to examples here. Maybe we get a nice list of examplary implementations that help users to start with django + ExtJs. Ext js Poll Tutorial Ext js vs. Jquery "Show how you can use extjs to display a table and how to use jqgrid 3.2 to get the same as in extjs. Incluses extjs and jqgird libraries. I have had to patch jqgrid adding" RESTful Web apps with Django, Piston and Ext JS Convert your forms.Form and forms.ModelForm to extjs and handles the form submission like any django form.

    Read the article

  • Advice? SSO in N-tiered SOA with mixture of REST and SOAP services

    - by Tyler
    Hi gang, We are moving to SSO in our N-tiered SOA applications. If all the services were SOAP, I'd be ok with just the WS-Security, WS-Trust, WS-Federation set of protocols. My problem is that many of the services are RESTful (ironic) and those protocols do not address REST services. What is your advice for SSO protecting the REST services in an N-tiered SOA architecture with the following requirements: ideally claims-based identity information available to the REST services original user (eg. bootstrap) information must flow through the tiers so that each service can "ActAs" or "OnBehalfOf" the user support sequences like: WebApp -- REST Svc -- SOAP Svc WebApp -- REST Svc1 -- REST Svc2 WebApp -- SOAP Svc -- REST Svc WebApp -- SOAP Svc1 -- SOAP Svc2 support SSO (and SSOff) service/web app platforms: ASP.Net and WCF Java end-user client platforms: .Net (WSE 3.0 and WCF) flash 10 java javascript and AJAX Normally I'm good at climbing / bashing my way through walls, but this one's knocked me flat. Hopefully with your help, we can get over this one. Thanks, Tyler

    Read the article

  • Why does this call to jQuery's $.ajax() fire an empty request in Chrome and Firefox?

    - by Martin Wiboe
    Hello, I am trying to call a WCF RESTful service from jQuery. I am using JSON to encode both request and response. The following code functions correctly in IE8: url = 'http://ipv4.fiddler:5683/WeatherWCF/NewBinding/MyService/GetValueFloat'; $.ajax({ url: url, data: '{"alias": "Udetemperatur"}', type: "POST", contentType: "application/json; charset=utf-8", dataType: "text", // not "json" we'll parse success: function(res) { alert('Received response: ' + res); } }); However, in both Firefox and Chrome, res contains an empty string. After using Fiddler to monitor the request, it appears that jQuery sends an empty request to the server as shown in this screen dump: http://imgur.com/EJgwS.png This is the successful request: http://imgur.com/S77BA.png What am I doing wrong? Kind regards, Martin

    Read the article

  • How do I interact with OData from Java?

    - by user280638
    OData is Microsoft's repackaging of its Astoria (now WCF Data Services) RESTful query/update protocol. If I want to use Java to create an OData compatible data source, how do I do that? Similarly, if I want to consume an OData data source from Java, how do I do that? http://www.odata.org/ Partial answer below. The OData website suggests that Restlet supports OData. Restlet's API documentation mentions the org.restlet.ext.odata package. www.restlet.org/ www.restlet.org/documentation/snapshot/jee/ext/org/restlet/ext/odata/package-summary.html Is this the only answer? Are there blog posts on doing this integration?

    Read the article

  • Jersey, Spring, Tomcat and Security Annotations

    - by jr
    I need to secure a simple jersey RESTful API in a Tomcat 6.0.24 container. I'd like to keep the authentication with Basic Authentication using the tomcat-users.xml file to define the users and roles (this is for now, like I said its small). Now, for authorization I'd like to be able to use the JSR 250 annotations like @RolesAllowed, @PermitAll, @DenyAll, etc. I cannot for the life of me figure out how to wire this all up together. I really don't want to go spring-security route, since I need something very simple at the current time. Can someone point me in the right direction.

    Read the article

  • Middleware for MongoDB or CouchDB with jQuery Ajax/JSON frontend

    - by Tauren
    I've been using the following web development stack for a few years: java/spring/hibernate/mysql/jetty/wicket/jquery For certain requirements, I'm considering switching to a NoSQL datastore with an AJAX frontend. I would probably build the frontend with jQuery and communicate with the web application middleware using JSON. I'm leaning toward MongoDB because of more dynamic query capabilities, but am still considering CouchDB. I'm not sure what to use in the middle. Probably something RESTful? My preference is to stick with Java (or maybe Scala or Groovy) since I'm using tools like Drools for rules and Shiro for security. But then again, I want to pick something that is quick an easy to work with, so I'm open to other solutions. If you are building ajax/json/nosql solutions, I'd like to hear details about what tools you are using and any pros/cons you've found to using them. Thanks!

    Read the article

  • Optional query string parameters in URITemplate in WCF?

    - by Shafique
    I'm developing some RESTful services in WCF 4.0. I've got a method as below: [OperationContract] [WebGet(UriTemplate = "Test?format=XML&records={records}", ResponseFormat=WebMessageFormat.Xml)] public string TestXml(string records) { return "Hello XML"; } So if i navigate my browser to http://localhost:8000/Service/Test?format=XML&records=10, then everything works as exepcted. HOWEVER, i want to be able to navigate to http://localhost:8000/Service/Test?format=XML and leave off the "&records=10" portion of the URL. But now, I get a service error since the URI doesn't match the expected URI template. So how do I implement defaults for some of my query string parameters? I want to default the "records" to 10 for instance if that part is left off the query string.

    Read the article

  • What web-development platform should I use considering Time-To-Market?

    - by Jonas
    I have been looking at a few differend platforms for my coming web-development project. I would like to hear what web-development platform is recommended when considering Time-To-Maket. Suppose that I already know the programming language well, but not the web-framework. The OS will be Linux. My requirements and priorities: Time-To-Market RESTful Maintainable code Scales-up (not dog-slow) The one I have looked at but never used are: Java and Play! Framework or GWT Python and Django PHP and Zend Framework Ruby and Ruby on Rails Erlang and Nitrogen and Webmachine Scala and Lift C++ and Wt C# and ASP.NET Mono It's a bonus if the framework has support for making sites for mobile phones.

    Read the article

  • Sending Facebook notifications

    - by antpaw
    Hey i have a little facebook iframe application written with rails and the facebooker plugin. I can loop through the users friends and see whether they also have this application. To do this I use a fql qeury, and my own html (no fbml). Now i want to create a button right beside every friend who doesn't have this app, that sends an invite massage. Is it possible to do this without this FBML/JS voodoo? I looked through the RESTful api but the only thing i could found was this deprecated method :( Can someone provide me an code example on how to do this? I really don't want to use this FBML stuff because it doesn't fit into the ui concept of the app, but if that the only way, please explain how to do this (every fbml tag I've tried is just invisible :( ) Thanks a lot.

    Read the article

  • How to pass a very long string/file into RESTWebservice JAX-RS Jersey

    - by Sashikiran Challa
    Hello All, I am trying to write a webservice that takes in an XML string, does parsing of it using DOM and extract particular things I want. My XML string happens to be very long so I do not want to pass it as a @QueryParam or @PathParam. Say If I write that XML string into a file, How do I go about writing a RESTful service that takes in this file, extracts whatever I want and return the results. I am actually trying to extract some number of strings, so my output should probably be an ArrayList having all these strings. Could somebody please shed some light on how I should go about doing this. Thanks in advance

    Read the article

  • Rails 3: What is the proper way to respond to REST-ful actions with JSON in rails?

    - by Damien Wilson
    Hello SO. I'm trying to make an API for my rails application using JSON responses to RESTful resource controllers. This is a new experience for me, so I'm looking for some guidance and pointers. To start things off: In a rails application, what is the "proper" way to respond with JSON to REST-ful controller methods? (create, update, destroy) Is there an idiomatic way to indicate success/failure through a JSON response? Additional information: I'm currently working with rails 3.0.beta2 I would like to avoid using a plugin or gem to do the grunt work, my goal is to gain a better understanding of how to make a rails 3 API. Links to places I could find more information on the topic would also be appreciated, some quick searching on google didn't do me much good.

    Read the article

  • MVC ActionLink generating NON-Restul URL AFTER adding constraints

    - by brianstewey
    Hello I have a custom route that without constraints generates a Restful URL with an ActionLink. Route - routes.MapRoute( "Blog", // Route name "Blog/{d}/{m}/{y}", // URL with parameters, new { controller = "Blog", action = "Retrieve" } Generates - http://localhost:2875/Blog/12/1/2010 From - <%=Html.ActionLink("Blog Entry - 12/01/2010", "Retrieve", "Blog", new { d = 12, m = 01, y = 2010 }, null)%> If I add constraints like so. routes.MapRoute( "Blog", // Route name "Blog/{d}/{m}/{y}", // URL with parameters, new { controller = "Blog", action = "Retrieve" }, new { d = @"\d{2}", m = @"\d{2}", y = @"\d{4}" } It generates - http://localhost:2875/Blog/Retrieve?d=12&m=1&y=2010 Extra information: it is added before the custom route. Any ideas? Cheers

    Read the article

  • Rails choking on the content of this request because of protect_from_forgery

    - by randombits
    I'm trying to simply test my RESTful API with cURL. Using the following invocation: curl -d "name=jimmy" -H "Content-Type: application/x-www-form-urlencoded" http://127.0.0.1:3000/people.xml -i Rails is dying though: ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken): :8:in `synchronize' Looks like it's running this through a protect_from_forgery filter. I thought protect_from_forgery is excluded for non-HTML HTTP POST/PUT/DELETE type requests? This is clearly targeting the XML format. If I pass actual XML content, it works. But my users will be submitting POST data as URL encoded parameters. I know all the various ways I can disable protect_from_forgery but what's the proper way of handling this? I want to leave it on so that when I do have HTML based forms and handle format.html, I don't forget to re-enable it for then. I want users to be able to make HTTP POST requests to my XML-based API though and not get bombarded with this.

    Read the article

  • form_tag for search model

    - by kip
    I have a search controller which is to be used to search over a separate model called house. The house model has a restful setup. I want the results listed on the index action of the search controller. The form_tag url is giving me some problems. What is the correct path for this? Below is the search form (search/form): <% form_tag index_search do -%> <p> <%= collection_select(:house, :category_id, Category.all, :id, :name) %> </p> <p> <strong>price</strong><br /> <%= text_field_tag :min_price, params[:min_price], :size => 3 %> <%= text_field_tag :max_price, params[:max_price], :size => 4 %>

    Read the article

  • how to rest my app to support mobile phone

    - by qichunren
    I am now going to develop a mobile website both support common html format page and wml format page(Because now a usual web browser on mobile can view html page and some old mobiles only support wml ) First step: register content type for wml page config/initializers/mime_types.rb Mime::Type.register_alias "text/vnd.wap.wml", :wml Second: Create two format page for an action in view: class WelcomeController < ApplicationController def index @latest_on_sale_auctions = Auction.latest(15) respond_to do |format| format.html format.wml end end end It works well as I visit: http://localhost:3000/welcome But got: Routing Error No route matches "/welcome.wml" with {:method=:get} as I visit:http://localhost:3000/welcome.wml and it works well as I visit:http://localhost:3000/welcome?format=wml my config/routes.rb like this: ActionController::Routing::Routes.draw do |map| map.root :controller => "welcome" map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' end My rails version is 2.3.5,please help me, I want a restful app,both support html and wml.

    Read the article

  • MVC2: "File not found" after view is painted

    - by Dave Hanna
    This is wierd. First, I'm building a site based on someone else's framework (Piers Lawson: Creating a RESTful Web Service using MVC ), so I'm not entirely sure what's going on under the covers. But when I run it in VS 2010 by pressing F5, it brings up the Home page, and THEN traps an error in Application_Error. The error is "File does not exist" exception. But I have no idea what file it's looking for. Where does flow control go after the View is finished displaying? How can I break to find out what it's looking for?

    Read the article

  • Framework for Implementing REST web service in Django

    - by Laizer
    I'm looking to implement a RESTful interface for a Django application. It is primarily a data-service application - the interface will be (at this point) read-only. The question is which Django toolsets / frameworks make the most sense for this task. I see Django-rest and Django-piston. There's also the option of rolling my own. The question was asked here, but a good two years back. I'd like to know what the current state of play is. In this question, circa 2008, the strong majority vote was to not use any framework at all - just create Django views that reply with e.g. JSON. (The question was also addressed, crica 2008, here.) In the current landscape, what makes the most sense?

    Read the article

  • What every web developer should know?

    - by arikfr
    Let's say you got a new intern, who's a third-year CS student. He has firm knowledge of the basics, has some experience with C/Java from the courses he took and a lot of desire to learn more. What would you teach him in order to become a good web developer? What I had in mind is: HTML/CSS and the importance of writing semantic markup Javascript, some JS framework (jQuery), JSON Basics of Git/Subversion (whatever you use) The language we use (Ruby, Python, PHP, C#, whatever) Introduction the web framework we use (Rails, Django, ASP.NET MVC...) MVC - what/why/who RESTful web services - how to consume them and how to create one What's on your list?

    Read the article

  • Modify headers in Pylons using Middleware

    - by Anders
    Hi all, I'm trying to modify a header using Middleware in Pylons to make my application RESTful, basically, if the user request "application/json" via GET that is what he get back. The question I have is, the variable headers is basically a long list. Looking something like this: [('Content-Type', 'text/html; charset=utf-8'), ('Pragma', 'no-cache'), ('Cache-Control', 'no-cache'), ('Content-Length','20'), ('Content-Encoding', 'gzip')] Now, I'm looking to just modify the value based on the request - but are these positions fixed? Will 'Content-Type' always be position headers[0][0]? Best Regards, Anders

    Read the article

  • Build Environment setup - Using .net, java, hudson, and ruby - Could really use a critique

    - by Jeff D
    I'm trying to figure out the best way to stitch together a fast, repeatable, unbreakable build process for the following environment. I've got a plan for how to do it, but I'd really appreciate a critique. (I'd also appreciate some sample code, but more on that later) Ecosystem - Logical: Website - asp.net MVC 2, .net 3.5, Visual Studio 2010. IIS 6, Facebook iframe application application. This website/facebook app uses a few services. An internal search api, an internal read/write api, facebook, and an IP geolocation service. More details on these below Internal search api - .net, restful, built using old school .ashx handlers. The api uses lucene, and a sql server database behind the scenes. My project won't touch the lucene code, but does potentially touch the database and the web services. internal read/write api - java, restful, running on Tomcat Facebook web services A mocking site that emulates the internal read/write api, and parts of the facebook api Hudson - Runs unit tests on checkin, and creates some installers that behave inconsistently. Ecosystem - Physical: All of these machines can talk to one another, except for Hudson. Hudson can't see any of the target machines. So code must be pulled, rather than pushed. (Security thing) 1. Web Server - Holds the website, and the read/write api. (The api itself writes to a replicated sql server environment). 2. Search Server - Houses the search api. 3. Hudson Server - Does not have permissions to push to any environment. They have to pull. 4. Lucene Server 5. Database Server Problem I've been trying to set this site up to run in a stress environment, but the number of setup steps, the amount of time it takes to update a component, the black-box nature of the current installers, and the time it takes to generate data into the test system is absolutely destroying my productivity. I tweak one setting, have to redeploy, restart in a certain order, resetup some of the settings, and rebuild test data. Errors result in headscratching, and then basically starting over. Very bad. This problem is complicated further by my stress testing. I need to be able to turn on and off different external components, so that I can effectively determine the scalability of each piece. I've got strategies in place for how to do that for each dependency, but it further complicates my setup strategy, because now each component has 2 options. A mock version, or a real version. Configurations everywhere must be updated accordingly. Goals Fast - I want to drop this from a 20 minute exercise when things go perfectly, to a 3 minute one Stupid simple - I want to tell the environment what to do with as few commands as possible, and not have to remember how to stitch the environments together Repeatable - I want the script to be idempotent. Kind of a corollary to the Stupid Simple thing. The Plan So Far Here's what I've come up with so far, and what I've come looking for feedback on: Use VisualStudio's new web.config transformations to permit easily altering configs based on envrionment. This solution isn't really sufficient though. I will leave web.config set up to let the site run locally, but when deploying elsewhere, I have as many as 6 different possible outputs for the stress environment alone (because of the mocks of the various dependencies), let alone the settings for prod, QA, and dev. Each of these would then require it's own setup, or a setup that would then post-process the configs. So I'm currently leaning toward just having the dev version, and a version that converts key configuration values into a ruby string interpolation syntax. ({#VAR_NAME} kinda thing) Create a ruby script for each server that is essentially a bootstrapping script. That is to say, it will do nothing but load the ruby code that does the 'real' work from hudson/subversion, so that the script's functionality can evolve with the application, making it easy to build the site at any point in time by reference the appropriate version of the script. So in a nutshell, this script loads another script, and runs it. The 'real' ruby script will then accept commandline parameters that describe how the environment should look. From there, 1 configuration file can be used, and ruby will download the current installers, run them, post-process the configs, restart IIS/Tomcat, and kick off any data setup code that is needed. So that's it. I'm in a real time crunch to get this site stress-tested, so any feedback that you think could abbreviate the time this might take would be appreciated. That includes a shameless request for sample ruby code. I've not gotten too much further than puts "Hello World". :-) Just guidance would be helpful. Is this something that Rake would be useful for? How would you recommend I write tests for this animal? (I use interfaces and automocking frameworks to mock out things like http requests in .net. With ducktyping, it seems that this might be easier, but I don't know how to tell my code to use a fake duck in test, but a real one in practice) Thanks all. Sorry for such such a long-winded, open-ended question.

    Read the article

  • Is it possible to implement X-HTTP-Method-Override in ASP.NET MVC?

    - by Greg Beech
    I'm implementing a prototype of a RESTful API using ASP.NET MVC and apart from the odd bug here and there I've achieve all the requirements I set out at the start, apart from callers being able to use the X-HTTP-Method-Override custom header to override the HTTP method. What I'd like is that the following request... GET /someresource/123 HTTP/1.1 X-HTTP-Method-Override: DELETE ...would be dispatched to my controller method that implements the DELETE functionality rather than the GET functionality for that action (assuming that there are multiple methods implementing the action, and that they are marked with different [AcceptVerbs] attributes). So, given the following two methods, I would like the above request to be dispatched to the second one: [ActionName("someresource")] [AcceptVerbs(HttpVerbs.Get)] public ActionResult GetSomeResource(int id) { /* ... */ } [ActionName("someresource")] [AcceptVerbs(HttpVerbs.Delete)] public ActionResult DeleteSomeResource(int id) { /* ... */ } Does anybody know if this is possible? And how much work would it be to do so...?

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >