rest

Symfony Basic API Http Authentication

Can someone point me in the right direction in regards to making an api use basic http authentication? I am creating a restful api with symfony but would like to require users to be logged in to get certain data. I would also like many of these methods be dependent on the the username in the authentication process in order to get some ...

Rails form helper and RESTful routes

Hey guys, I have a form partial current setup like this to make new blog posts <% form_for([@current_user, @post]) do |f| %> This works great when editing a post, but when creating a new post I get the following error: undefined method `user_posts_path' for #<ActionView::Base:0x6158104> My routes are setup as follows: map.resour...

MediaType of REST

Hi, I am beginner in REST web services. I wrote a program of REST to display the HTML or XML. The @Path annotation's value is @Path("{typeDocument}"). There are two methods for GET : @GET @Produces(MediaType.TEXT_XML) public String getXml(@PathParam("typeDocument") String typeDocument) to display XML file, and @GET @Produces(MediaTy...

WCF (REST) multiple host headers with one endpoint

I have an issue with a WCF REST service (.NET 4) which has multiple host headers, but one end point. The host headers are for example: xxx.yyy.net xxx.yyy.com Both host headers are configured in IIS over HTTPS and redirect to the same WCF service endpoint. I have an Error Handling behavior which logs some extra information in case of a...

How do you prevent brute force attacks on RESTful data services

Hi, I'm about to implement an RESTful API to our website (based on WCF data services, but that probably does not matter). All data offered via this API belongs to certain users of my server, so I need to make sure only those users have access to my resources. For this reason, all requests have to be performed with a login/password com...

Zend Rest Client issue

Hi all i have the codes below class ReservationController extends Zend_Controller_Action { public function init() { } public function indexAction() { $this->_helper->viewRenderer->setNoRender(); $this->_helper->layout->disableLayout(); $soap = new Zend_Rest_Server(); $soap->setClass...

More HTTP verbs with AS3?

I'm developing a social game in Flash with a team of developers. Our server-side guy has developed a really slick RESTful API for the Flash client to talk to. A lot of the client-server interactions involve adding and removing objects from a persistent world, so the API makes extensive use of the PUT and DELETE verbs. The problem is, ...

Setting up restful routes as a total newb

I'm getting the following error: Unknown action No action responded to show. Actions: activate, destroy, index, org_deals, search, and suspend Controller: class Admin::HomepagesController < Admin::ApplicationController def org_deals @organization = Organization.find(:all) end Routes: map.root :controller => 'main' map.admin...

WCF Rest service authentication

Hi, I am trying to write my first WCF Rest service following http://msdn.microsoft.com/en-us/library/ee391967%28v=MSDN.10%29.aspx Sometimes when I go to websites they ask a user to enter a username and password... I just wanted to know when Im testing my service with Http Get options in a browser, Is there a way so that the browser a...

Changing HTTP header in Rails

I am trying to communicate with a RESTful service in Rails. It can return data in different formats, json and xml. Is there a specific way that I can get the data type that I want. The service mentions that ACCEPT needs to be set in HTTP header. I am not sure how to do that in Ruby. Currently I'm doing this for get response = Net::HTT...

EclEmma JAVA Code coverage - Unable to coverage service layer of RESTful Webservice

I am using EMMA eclipse plugin to generate code coverage reports. My application is a RESTFul webservice. Junits are written such that a client is created for the webservice and invoked with various inputs. However EMMA shows 0% coverage for the source folder. The test folder alone is covered. The application server(jetty server) is st...

Creating Versatile Web Services sustaining high load - .NET

Hello I've a multi user web tool which makes use of a intermediate web service to communicate with an external datasource. The application makes frequent calls to the web service and it may involve intense data transfer, sometimes. I want to make a scalable architecture where thousands of users can make use of the web service at the sa...

RESTful: Best URI practice in parameterized request of data?

Hi! Trying to get the grips of best URI practice in RESTfulness... Let's say that /service/user.xml returns an xml with all users data /service/user/1.xml returns an xml with data for user id 1 What if I want to get just the email address of the user(s)? /service/user.xml?par=email or /service/user/email.xml for all users? /servic...

Simplest code snippet to add a tiny REST endpoint to an Azure Worker Role

I would like to be able of adding a tiny REST endpoint to an Azure Worker Role, just dumping some non critical monitoring meta-data. I can think of many complicated ways of doing that, but I feel there are simpler solutions. What would be your code snippet to tackle this? ...

Custom Prints to Products API affiliate

Hi Everyone, I have been working on using cafepress API to create custom products with prints from a website. The problem is that cafepress documenation lacks and there is hardly any support for it. I was wondering if anyone else knew good APIs that are out there which allows RESTful API integration to create custom products and sell t...

MIMEParsingException in REST

I have a question about MIMEParsingException. I use JEE 6 with NetBeans 6.8. I write a simple REST web service in Java to print "hello world", it runs well. Then I write a REST web services client (Java Main Class) to test REST : public class HelloWorldClient { /** * @param args the command line arguments */ public static void main(...

How to distinguish 404 between entity doesn't exist and incorrect endpoint?

Using REST principles, 404 seems to be used to indicate that an entity does not exist. However, how can clients distinguish this case from hitting an incorrect endpoint altogether? I want to distinguish between, "you came to the right endpoint, but that entity doesn't exist" and "you're not at the right endpoint". Technically, this ca...

Rails Model and calling another Controller from a View RESTfully

I have an application where I create an array of objects (Matches) that do not inherit from ActiveRecord. They are presented in a view and the user selects which they want to play. At that point, I want to create a new MatchHistory object, which does inherit from ActiveRecord. The array itself is also an object (Round). I wonder if my o...

Facebook REST api Application Secret

I'm trying to retrieve a list of my friends' birthdays using the following code. I'm using Facebook's FQL method using the old REST API. <?php $appapikey = '<app api key>'; $appsecret = '<app secret>'; $token = 'access_token=<token>'; $fql = "SELECT uid, first_name, last_name, birthday, sex, proxied_email FROM standard_user_in...

How to consume RESTful web service in my JSF project?

Hello, As RESTful web services is url based and is not a object, we can't call methods on it. I have a simple web service with only one method in it with is @GET. I saw one screencast and it used some javascript library to consume the web service. But, how do i use it with my JSF project? I can't even inject it like a normal web service...