rest

Is it better to specify a relative address in an endpoint or in a UriTemplate?

Is it better practice to specify a relative address in an endpoint for example <endpoint address="json" ... /> or in the UriTemplates: [WebGet(UriTemplate="json/....")] What is better practice here? Does it matter? I know if I decide to change json to js later, I would have to change it in all the UriTemplates, but only one time ...

Do WCF Services have to have a MetaDataExchange endpoint for each service or can I have just one?

If my WCF Configuration file has two services, lets says LoginService and RegistrationService, do they both have to have their own MetaDataExchange endpoint or can I just have one MetaDataExchange endpoint and keep it outside the service element: <services> <service name="a"> <endpoint binding="mexHttpBinding" /> </service> <service nam...

Are there any efficiency beneftis to PUT and DELETE HTTP methods?

Most of the Web servers and frameworks support by default GET and POST HTTP methods and do not promote or even disallow usage of PUT and DELETE methods. I know using the latter is conceptually more appropriate and e.g. minimizes the URL scheme of the site, but are there actually any concrete efficiency benefits involved (like less reques...

Deciding on RESTful Architecture for my Python code API

I would like to build something like this Datastore | mycode.py | RESTful API | mywebapp.py(Django or Tornado) I checked Piston for Django but it seems that this way I am going to be tied to Django, I would rather have a RESTful API for mycode.py that is consumable by more than one REST client and also can consume it from a REST client...

Multiple problems with HttpWebResponse

So I am trying to create a simple class which I could use to consume REST web services. However I am having some troubles with HttpWebRequest object. Here is my code: using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; ...

DELETE request in ajax giving 301 moved response

Hi, I am trying to make a delete request using ajax method of jquery as follows $.ajax( { type: 'DELETE', url: '/tagz', data: {id: taskId}, success: function(data) { console.log(data); } }); And when I see the console in chrome, I find in the request headers that a GET request is made instead of DELETE. and in firefox ...

From where to serve multi-Resource Web UI pages in a RESTful architecture?

Almost all web content can be a resource to be served up on its own. Web front-ends, however, mix unconnected resource content in order to serve the user with some desired experience. A blog page might be laid out with its articles stacked on the left and a list of the site's other popular blogs on the right, as an example. Let's say ...

What kind of security do I need for the following WCF Rest scenario?

The Response format can be either JSON or XML. The clients accessing the Service(s) will be web browsers, IPhones, Android Phones, all kinds of smart phones and other types of devices. The username and password for the users will be stored in a sql server database. I can't pass the username and password in the UriTemplate. There will...

Best way to protect a REST service that will be accessed by mobile and desktop applications

I have REST services that I was planning on protecting with Windows Integrated Authentication (NTLM), as it should only be accessible to those internal to the company, and it will end up being on a website that is accessible by the public. But, then I thought about mobile applications and I realized that Android, for example, won't be a...

How to make a REST call in JSP?

Hi, everyone, I want to ask a question about the JSP and REST call. I am making a JSP page and need to mark a REST call and receive the REST call in JSON format. The JSP (.war) is running on the tomcat server. Like the following: JSP(REST call) -> server -> JSON format(REST respond) However, I don't know how to make the call and respo...

Is there such software/library to convert REST to SOAP and vice versa?

I have some back end web services, SOAP web services. I would like to create an android client to use these. I'm under the impression that SOAP style web services are non trivial to setup on android, and I would prefer to use REST if possible Is there any utility that can convert REST calls to SOAP and back again? Or will I need to cre...

WCF REST : Case insensitive Query String Parameters, suggested naming convention - use underscore or ???

Hi there, It appears the query string parameters you can pass to a rest method in WCF REST is case insesitive - actually this makes sense. What the best naming convention for parameters with 2 words, using an _ (underscore) ?? I never liked this, i prefered to use camelCasing but if its insensitive what other options to do i have? for...

Content-Length header with HEAD requests?

The http spec says about the HEAD request: The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request. Should the response to a HEAD...

How to return a formated error message and the right HTTP code using django-piston ?

Hello, I would like to be able to return a HTTP Reponse with a formated content with django-piston. I guess I have to create my own rc_factory. What I would like to do is : return rc.404({'status': 0,'message': 'This restaurant does not exists.'}) With a result provide by XMLEmiter, JSONEmiter or YAMLEmiter regarding to the format ...

Multiple entity replacement in a RESTful interface

I have a service with some entities that I would like to expose in a RESTful way. Due to some of the requirements I have some trouble finding a way I find good. These are the 'normal' operations I intend to support: GET /rest/entity[?filter=<query>] # Return (matching) entities. The filter is optional and just a convenience for us CLI ...

C# REST client sending data using POST

I'm trying to send a simple POST request to a REST web service and print the response (code is below, mostly taken from Yahoo! developer documentation and the MSDN code snippets provided with some of the documentation). I would expect the client to send: Request Method: POST (i.e. I expect $_SERVER['REQUEST_METHOD'] == 'POST' in PHP) Da...

Facebook Apps: Adding Tags To Photo's

I was wondering if the old REST api will be supported for a long time... I need support for tagging on images, which was available in the old rest api (http://developers.facebook.com/docs/reference/rest/photos.addTag), but not anymore in the new graph api I've found that a couple of methods are still going to be depreciated at the end o...

Can you only use webHttpBinding with REST?

I know you can use multiple bindings, but if you implement a REST Service, must you use the webHttpBinding? ...

REST Solutions for Complex Data Structures

I'm currently architecting an API and one solution we are leaning towards is to use REST. A key issue is the parameters being passed are complex data types including nested hashes, hashes of arrays of hashes, etc. The philosophy is that the user should be able to complete their tasks with a minimum number of API calls. One common solut...

How can I speed up Restlet for Android when using OData?

I am attempting to use Restlet for Android to query an OData data source. However, I am not impressed with its performance in both the emulator as well on a real device. I have the requests made in a wrapper AsyncTask to make the UI responsive but it still takes over 1 minute to finally return the objects. I get plenty of these in the L...