rest

GET or PUT for a REST request

I've got a situation where a client app can ask for a resource matching certain criteria, and if a matching resource does not exist it is created and cached. Subsequent requests for the same criteria will return the cached resource. I could implement this via a PUT request to create the resource and subsequent GETs. However, in my parti...

Self-hosted WCF REST service and Basic authentication

I've created a self-hosted WCF REST service (with some extra's from WCF REST Starter Kit Preview 2). This is all working fine. I'm now trying to add Basic authentication to the service. But I'm hitting some rather large roadblocks in the WCF stack which is preventing me from doing this. It appears that the HttpListener (which self-host...

Download file and display contents with javascript

I have a simple webpage which has a link, on pressing it a file is downloaded(rest web service call). I need to read the file and display the contents using javascript. How do I do this? ...

How to implement Intuitive website URL using .NET plateform ?

Hi, I'm trying to implement a "restful" application using ASP .NET 3.5 but it seems that I need to use MVC .NET. Is that the only solution? For instance, I would like something like: /api/nab/(version)/(slug) I'll be happy to know how you manage to do that. ...

How can I get a FormPanel to POST JSON with ExtJS 3.1.0?

By default, a FormPanel in ExtJS 3.1.0 posts the form fields as application/x-www-form-urlencoded when you call its submit() function. Is there any way to get it to post JSON instead? ...

Picking the right HTTP return code for future resources

Hi, I'm currently designing a RESTful API and are not sure which HTTP code is the right choice for a distinct scenario: Clients can upload entities by using PUT to a pre-known URI. Then, the entity is processed on the server which could take some time (i.e. transcoding/processing). If this is done, the resource is available under the U...

Using Http Pipelining for Rest on IIS

Given a workflow that I support, there is a high chance that there would be at least a hundred consecutive calls to the same resource done in rapid succession. I started looking into batching calls for Rest and ran into people suggesting Http Pipelining as the solution. My understanding is that the client will be able to make dozens of r...

Undocumented UPS API question

At work, I'm working on including UPS integration for our product's shopping cart. I'm currently using the documented API, which supplies WSDLs. To use this API, you need a username, password and API key (our customers who use the cart for their business will have to provide this information). There is another (undocumented) API for cal...

REST interface usage for multiple resources

I am currently adding a REST API over http to an online service and I am confronted with a very simple problem for which I cannot find an answer that satisfies me: I have mainly 2 resources: 'user' and 'reports', as you would have guessed reports are associated to users (to one and only one, = foreign key in my db) Anyway I have this u...

Why can't I get my Azure, WCF, REST, SSL project working? What am I doing wrong?

I'm trying to get SSL, WCF and REST under Azure, but the page won't even load. Here are the steps I followed: 1) I mapped the www.mydomain.com CNAME to my azuresite.cloudapp.net 2) I procured an SSL certificate for www.mydomain.com and properly installed it at my azuresite.cloudapp.net hosted service project 3) I deployed my WCF REST...

Why isn't the Flickr API RESTful?

I'm about to start developing a REST API for a client's website and I've been doing some research. I came accross this useful SO question on the gold standard for APIs: http://stackoverflow.com/questions/297005 Prior to reading this post I'd thought about using the Flickr API as a point of reference. However this comment on the above qu...

Cache-control policy for search resource on RESTful API

I'm creating a RESTful API (using MVC.NET) to allow external access to a business system. The API includes a search resource. The resource takes the URI form "/example/search/pages/1/?query=something". Example: To search for pizza you would access the URI "/example/search/pages/1/?query=pizza" which would give you the first 10 resul...

JAX-RS Element name for return type Collection

I have a situation where the method signature of JAX-RS service looks like... public Collection<CustomerData> getCustomers() { ... } The xml generated has the root tag like customerDatas as below <customerDatas><customer>.....</customer></customerDatas> I am using JAXB annotations and root element name for CustomerData is custom...

REST URI definition

Hi, I'm reading REST and nearly ready to try it but I can't get comfortable with a coupel of things. The first is to do with defining the URI's. The scenario is an existing site with products for sale. You can view data in a number of views, driling down a hierarchy, but basically cat1/cat/ products, or cat 2/cat3/products or anycombin...

REST - Modify Part of Resource - PUT or POST

I'm seeing a good bit of hand-waving on the subject of how to update only part of a resource (eg. status indicator) using REST. The options seem to be: Complain that HTTP doesn't have a PATCH or MODIFY command. However, the accepted answer on http://stackoverflow.com/questions/1672025/http-modify-verb-for-rest does a good job of show...

Is this a bad REST URL?

I've just been reading about REST URLs and seen the following example: /API/User/GetUser Now if this is accessed over HTTP with a verb GET isn't this a bad URL becuase it describes the action (GET) in the URL? ...

Using ActionLink and specifying the DELETE Constraint

I'm using RestfulRoutes written by Steve Hodgkiss. So far so good but I do have a question. I have a Session Controller that I want to use to destroy a users session when they click the logout button. How can I do this with and action link? So far I have the following. <%= Html.ActionLink("Logout", "Destroy", "Session") %> I need to ...

Client-side templating frameworks to streamline using jQuery with REST/JSON

I'm starting to migrate some html generation tasks from a server-side framework to the client. I'm using jQuery on the client. My goal is to get JSON data via a REST api and use this data to populate HTML into the page. Right now, when a user on my site clicks a link to My Projects, the server generates HTML like this: <dl> <dt>Cl...

Difference between WSDL 2.0, WADL & XRD?

WSDL 2.0: www.w3.org/TR/wsdl20/ WADL www.w3.org/Submission/wadl/ XRD www.oasis-open.org/committees/download.php/35274/xrd-1.0-wd10.html All three can be used a REST API descriptors. What's the differences? I know this is a heated question, but I simply want a comparison, not a flame war :P ...

Asynchronous request handling using JMS for RESTful web services

I just want to know how to make my REST web service respond to asynchronous request.that is how to go about REST over JMS using apache tomcat or glassfish as my web server. ...