rest

Parsing JSON with Javascript

I have a webservice (RestEasy) returning a JSON object containing a List<..> element. I am trying to parse the results in a Javascript for loop. If the List<> element has 2 or more elements, all is well. If the List<> element has only one element, the Javascript loop breaks. This is because the JSON respresentation actually changes when...

How to pass parameters to rest web service without using the (?) Symbol ?

I have developed a rest web service by using the following link http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/simplerestservice11172009221218PM/simplerestservice.aspx Now, I am passing parameters to this rest web service by using URL. I am passing parameters as follows http://localhost:50362/PMTSRest/Service.svc/GetProjects?...

Rails restful routes and singular resources

I am having a problem with restful routes and singular resources, originally I had this code in the show view on my account resource. <%= link_to book.title, book_path(:search => book.title) %> and it worked fine, then I changed account to be a singular resource, e.g from map.resources :accounts to map.resource :account and now...

Advice on writing a rich Web UI to front a RESTful HTTP API

Hi all, I've been working on a set of RESTful HTTP services implemented using Restlet in Java. Those services are currently used by a proprietary desktop application running on Windows, and by other back-end services. My goal now is to design an Ajaxy user interface to these services that will run within the Web browser. I am aware of ...

How to build URL of WCF REST web services

Hi, I am using the new .NET 4 WCF REST web services. In order to link resources, I'd like to put links in my responses. In ASP.NET I can generate URLs from my routing configuration (e.g. UrlHelper.Action(...)) With WCF REST web services I have an ASP.NET routing configuration plus Uri templates: [WebGet(UriTemplate = "{id}")] MyResult ...

Raw socket listening to a REST Channel in Silverlight

I understand how I can use a raw socket to listen to a server application and recieve information but I need an easy to access API and I am very familiar with REST. Is there a way to push (not by using long pooling) data using a WCF service? Here's my idea of how things should happen, at least at the begining: The client accesses a U...

REST API Best practices: Where to put parameters?

A REST API can have parameters in at least two ways: As part of the URL-path (i.e. /api/resource/parametervalue ) As a query argument (i.e. /api/resource?parameter=value ) What is the best practice here? Are there any general guidelines when to use 1 and when to use 2? Real world example: Twitter uses query parameters for specifyi...

Error using ActiveResource with Rails 3 and REST API

I have a REST API that I am trying to access using Rails 3.0.1 that returns: <Sessions> <Session> <Title>This is a sample title</Title> ...Misc </Session> <Session> <Title>Another Title</Title> ...Misc </Session> </Sessions> I have set up my session.rb class defined: class Session < ActiveResource::Base self...

REST library which support Windows Phone 7 and silverlight ?

Are there any .net REST libraries which support Windows Phone 7 and silverlight? ...

Problem creating DataContract with SVCUTIL

I am trying to create a DataContract for a simple REST based webservice using a XSD file. <?xml version="1.0" encoding="utf-8"?> <xs:schema id="workcodes" xmlns="http://timesheet.domain.com/webservices/workcodes" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="unquali...

Shorten path of REST service in JBoss Seam application still wrong

I got a similar question as: http://stackoverflow.com/questions/3248814/shorten-path-of-rest-service-in-jboss-seam-application/3248902#3248902 But couldn't comment on the shipmaster answer because of my initial rep. His comment Jul 19 at 18:10 misunderstood the situation: Faces servlet is mapped by url-pattern *.xhtml and Seam Resource ...

SILVERLIGHT: How to access a restful service from silverlight

Hi. What is the standard way of accessing a restful service from silverlight (I am targetting v3 of silverlight)? In .net i use REST Starter KIT but its not compatible with Silverlight - although i did find a port but unsure weather to try it. Is there a standard way to access rest from silverlight? Any good examples or tutorials? A...

Rendering different controller actions in Rails when using resource-oriented controllers

Say I'm making a Q&A site like StackOverflow. I have two resources: Question and Answer. I'm using default Rails RESTful resource routes, so each resource has its own controller and methods for creating it. In the /questions/show view, I want to allow the user to submit an answer for the particular question. The form will POST to /answe...

Why is XMLHttpRequest.status == 0 on all the browsers except IE?

Hi guys! I'm getting insane with this one... I made a RESTful.NET webservice with C# and is running as a standalone service. When I make a XMLHttpRequest to retrieve JSON data, all browsers fail, except IE, because the status flag of the instance of XMLHttpRequest is always 0 -- it should be 200, that it's what's happening with IE. I ...

How to ensure message transfer by pull-/polling from a webserver.

This builds on How to send messages between Companies. If I decide that company S(upplier) should poll orders from company (B) in some simple HTTP based Way what is the best implementation. I assume Company B has a Webserver running and the backend database of this Webserver is durable. We should make as few a possible assumptions abou...

How to call RESTFUL services from GWT?

I'm using GWT as web development framework. I need to access some REST services from my GWT client code. Also I need to parse JSON (or maybe XML) which is response format of these services. Which is the best way for this problem? Thanks in advance. ...

File upload in Resteasy

How to upload files using RESTEasy framework ? ...

Post binary data to a RESTful application

Hi, I'm working on a RESTful web application (Django+Piston). The POST request sends data encoded with Json to the web application. This works fine for all my text only database tables but I also have a table which stores text and binary files. What is the best way to post text and binary data to a RESTful application? ...

JQuery Batchbook Rest API Consumption

Given the following API call in Curl, how would I do this in JQuery? curl -u #{api_key}:x -X GET https://#{your_account}.batchbook.com/service/people.xml ...

REST convention for resources with slashes

Is there any REST convention for handleling resources with slashes? For instance, let's say a normal REST resource works like this: /ice cream/chocolate - returns the ingredients of chocolate ice cream /ice cream/rocky road - returns the ingredients of rocky road ice cream /ice cream/strawberry/banana - returns the stawberry banana in...