rest

REST http status code for content that needs authentication?

I have a web application that uses RESTful url patterns. Currently if a users tries to access a page where they need to be authenticated it just returns nothing. Is it good practice to return the HTTP status code in this case? Would I use 403 or a different one? ...

RESTful authentication for web applications

Hi already wrote this observation and question on this question earlier, but only later noticed that it was an old and "dead" question. As I'd really like some insights from others, I'm reposting it as a new question. To the question of how to do authentication RESTfully, people generally enthousiastically shout "HTTP Authentication". H...

Decoding query strings in PHP

Okay, so I've written a REST API implementation using mod_rewrite and PHP. I'm accepting a query string via the body of HTTP DELETE requests (... collective groan?). Arguments about the wisdom of both previous statements aside, what I've found is that PHP doesn't automatically parse the request body of DELETE requests (i.e. $_POST is e...

Actual examples for HATEOAS (REST-architecture)

Hi, as everyone may have noticed, there are lot of fake/rudimentary REST-APIs in the wild (which implement a HTTP-API and call it REST without following the hypertext-as-the-engine-of-application-state requirement, which led to the famous rant of Roy T. Fielding, the man who first specified the REST-paradigm). I've been unable to find ...

[.Net Service-Access Control Service] cannot get issuetoken by using REST

In the white paper, it said that we can use REST to ask for the token then use the token to attache to the request we are going to fire, then can invoke the service in the service bus, how ever, i cannot get the token Bellow are the codes i use to make REST call, i can get the result, but which was a html error page.. i didn`t get any t...

Securing REST and JSON

I want to build my web services serving JSON data utilizing RESTful architecture. But I want my own client apps only that can request from my web services. Basically, my web services contain sensitive data that is not for public consumption, but I wanted to build it that way so I can build many different client apps that connects to my...

Creating a RESTful API and website with PHP

I've got a PHP application I wrote earlier that I'd like to add a RESTful API to. I'd also like to expand the site to behave more like a Rails application in terms of the URLs you call to get the items in the system. Is there any way to call items in PHP in a Railsy way without creating all kinds of folders and index pages? How can I ca...

Wrapping REST API - Coding Styles Standards

If you are wrapping an API which has different coding style guidelines to the programming languages you are using, do you create an interface that complies with the languages style guidelines or expose the implementation to the user of the API wrapper. A specific example is for ruby and python variables are usually all lowercase and use...

Issue Returning Entity Framework 4.0 Entity from a WCF REST Service

I'm trying to return an EF object from a WCF REST service. It works fine when I do not eagerly load any child objects but once I do, I get a 404 error when I try browsing the service using Internet Explorer 7.0. ...

Send java object to a rest WebService

Hi, I'm searching a nice way to send a java object to my rest web service. It's possible or not ? For sample I wan't to send an "User" Object to my rest : public Class User{ private String name; private String surname; public getName(){ return name; } public setName(String name){ [...] } It's possi...

How to make custom WCF error handler return JSON response with non-OK http code?

I'm implementing a RESTful web service using WCF and the WebHttpBinding. Currently I'm working on the error handling logic, implementing a custom error handler (IErrorHandler); the aim is to have it catch any uncaught exceptions thrown by operations and then return a JSON error object (including say an error code and error message - e.g....

Rails, trouble in a form trying to use the put http method

<% form_ tag user_path(@user), :method => :put do %> That's my form, so I want it to access the update method of my UsersController, I set the map.resources :users , and the RESTful paths generated: users GET /users(.:format) {:action=>"index", :controller=>"users"} POST /users(.:format) {:a...

REST client for Amazon s3 in J2ME

Does anyone know of a client implementation for the S3 REST API that will work on J2ME? All the implementations I can find is only targeted for J2SE. I do not want to use the SOAP API, because I think REST will be faster (partly because you don't need to BASE64 encode the payload). Edit: Part of the problem seems to be that J2ME does n...

Is this RESTful?

I have a Rails app that needs to expose values from a database as a web service - since I'm using Rails 2.x, I'm going with REST (or at least try). Assuming my resource is Bananas, for which I want to expose several sub-characteristics, consider this: - /banana -> give a summary of the first 10 bananas, in full (all characteri...

RESTful Web Service Implementation using JSON

I'm trying to create a REST web service that exposes the following Django model: class Person(models.Model): uid = models.AutoField(primary_key=True) name = models.CharField(max_length=40) latitude = models.CharField(max_length=20) longitude = models.CharField(max_length=20) speed = models.CharField(max_length=10) ...

Architectural best practices - where to put non-REST actions?

I'm making my first real Rails app, and am learning about REST architecture and how it fits into Rails apps. My controllers don't really seem to map logically to an individual resource, so it's tough for me to implement strict REST. For instance, I have a "catalog", "checkout" and "admin" controller, not a "products", "categories", "orde...

Which framework offers similar functionalities to ADO.NET Data services

I am new to both Django and Rails. I am thinking of developing an Web 2.0 style application and is planning to expose Restful services, which my UI tier would call to make CRUD operations (Something similar to ADO.NET Data services) I am yet to decide on the platforms and is looking for some advice on which one to side develop on? I am...

How do I write a restful web service that accepts a binary file (pdf)

I'm trying to write a restful web service in java that will take a few string params and a binary file (pdf) param. I understand how to do the strings but I'm getting hung up on the binary file. Any ideas / examples? Here's what I have so far @GET @ConsumeMime("multipart/form-data") @ProduceMime("text/plain") @Path("submit/{client_id...

Where to start REST web service in C# or ASP.Net

I am thinking to start writing some REST web services as a way to provide data. I guess that when my REST web services are available, then some of my web applications and console applications will be able to use REST web service as data service to get, add, update and delete data to databases. In addition to that, I would like to add aut...

Is there any computer-related price API available out there ?

My website lists some computer parts (like CPU, RAM, graphic card and so on) and I would like to display the current price for each of theses parts. So, I would like to know if you've heard about a public and free API which, given a computer-related product name (like "Intel core 2 duo E8400") will return a price. I would like to reque...