rest

POSTing a DateTime from Android to a WCF RESTful JSON Service

Hi, after hours of research I still haven't found any answer. I'm trying to send a DateTime as a Parameter to a Method exposed over a WCF RESTful Service with JSON encoding. The request looks like this: POST http://IP:PORT/LogService/json/GetLogEntriesByModule HTTP/1.1 Content-Length: 100 Content-Type: application/json Host: IP:PORT Co...

Timeout using HttpWebRequest to invoke self-hosted WebHttpBinding WCF REST service over SSL

Hello all, I've written an WCF-based restful web service as a Windows service and I am accessing it via raw HttpWebRequest from a console application. It works great when I set everything up for plain http. But now, I'm trying to set it up for SSL access using the ASP.NET role provider. Now when it executes request.GetResponse() and it...

What design pattern to implement in order to use a REST API?

I'm starting a new project that will require use an external REST API that basically returns JSON and XML files. It's similar to the StackExchange API and I see every wrapper that has be done for that API has a different approach; for instance, stackoverflow-java-sdk uses the Adapter Pattern. So, in order to make sure every new API feat...

How to debug socket error

Hi! I've this code: 1 upload_odl function import os import urllib2_files import urllib2 user = 'patrick' password = 'mypass' url = 'http://localhost:8000/api/odl/' password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() password_manager.add_password( None, url, user, password ) auth_handler = urllib2.HTTPBasicAuthHandler(p...

What is the correct way to create a database desktop application ?

I just realized that there is no best way to hide MySQL string connection password in my executable file, especially in JAR file. Even encrypting it in EXE would only slow down the process (although I'm not sure how much time would it take to get an encrypted password from an EXE file). So, from my understanding, I need something in th...

Any Spring Framework support for REST security?

I am about to implement security for my RESTful services based on the Spring framework. Actually, I have never secured RESTful WS before, but I've got myself a good introduction here. Basically, Amazon S3 or even OAuth are suggested as good examples. My questions: Does the Spring framework provide these strategies out-of-the-box? If ...

REST Layer Security And Integration

I have an widget-based front end talking to a REST layer. To use the front-end, a human needs to log in with a username and password. Once in, the user can interact with the widgets, which make calls to the REST layer. At this point, no authorization is done at the REST layer. If you have logged in successfully, you can do whatever you w...

Web directory of RESTful web services?

Is there something like a directory, list, search engine, or index of RESTful WS in the web? Edit: What I am looking for is a list or a directory in the internet like this: Yahoo: Maps Service, http://developer.yahoo.com/maps/rest/V1/geocode.html, http://local.yahooapis.com/MapsService/V1/geocode?appid=YD-9G7bey8_JXxQP6rxl.fBFGgCdNj...

how to make a delete / put request in python

i can make get or post request using urllib. how do i make delete and put requests? ...

ModSecurity: Output filter: Failed to read bucket (rc 104): Connection reset by peer

Hi, I'm doing a POST request to a rest service made with django and piston uploading a file, but when I do the request i get this (strange?) error: [Sun Jul 04 16:12:38 2010] [error] [client 79.39.191.166] ModSecurity: Output filter: Failed to read bucket (rc 104): Connection reset by peer [hostname "url"] [uri "/api/odl/"] [unique_id "...

Pagination in a REST web app

Usually, a user makes a search, get a hitlist, and can then browse it. The hitlist is an intermediate result that remains consistent throughout the browsing and is typically stored in session state. E.g. if new items are added concurrently by some other, they would appear only in a subsequent search. In a REST application, I can't have...

WCF: Destinguish between REST and SOAP requests using the OperationContext

In WCF security, given the current OperationContext, what is the best way to determine whether the request is a SOAP request or a REST request? ...

What is the good starting point to developing RESTful web service in Clojure?

I am looking into something lightweight, that, at a minimum should support the following features: Support for easy definition of actions through metadata Wrapper that extracts parameters from request into clojure map, or as function parameters Support for multiple forms of authentication (basic, form, cookie) basic authorization based...

How KeepAlive HTTP header should look like in a sniffer?

I am trying to make Http connections made by C# HttpClient helper class reusable. I read that there is KeepAlive header which has to be present in Http request. I sniffed the traffic and I cant find any reference to KeepAlive. It has GET and it has HTTP/1.1 strings in there. No KeepAlive no nothing. P.S. I also tried to find KeepAliv...

C# Cant reuse Http connections. No KeepAlive header. HttpWebRequest.KeepAlive = true;

Ok. Here is the full code. I tried to reuse connections setting KeepAlive but it simply doesnt work. I looked in the Http messages using Feedler and Charles but all I can see is Connection: close in response. I see 600 TCP connections in wait state opened by 10 threads. Each thread run one http requst at a time. There is also bunch of ...

C# How to force reusing authenticated Http connections?

I cant make my Http connections to be reused. HttpWebRequest.KeepAlive setting makes no difference. I found this article which says that if you have NTLM authentication then use UnsafeAuthenticatedConnectionSharing = true. So I set it to true and still have same bunch of TCP connections and nothing similar to reuse.. Any thoughts? ...

Sending protocol buffers via REST

Hi, I am trying to implement protocol buffers for client/server using REST. I am still a bit confused if I need to send protocol buffers request in byte format? I mean, in my client code, do I need to serialize object to byte array? For example protoRequest.build.toByteArray() And in the server, do I need to c @POST @Consumes...

RESTful VS XML-styled requests

I'm developing API for booking(hotels, cars, apartments, etc.) system. Response will be in XML but how to handle requests in the best way ? Should they be an XML requests like on Travelfusion or RESTful like on Cleartrip ? Service is written in Grails. ...

Ignoring webservice errors. TryXXX pattern

I have a method that need to try to update my twitter status. I will send a lot of messages and I want to continue if some message throw a error. Today I catch everything, but I dont like. Maybe should I put this catch at the caller? Or return exception instead bool? public bool RefreshStatus(string status, out Status newStatus) ...

RESTful uploading of a file in PHP

Hello Everyone, So I'm working on a script that's going to upload a video to a server via a RESTful interface. The documentation tells me that I should pass the data (including the binary video file) as part of a POST request. I know how to set my POST variables, but I'm not sure how to do the binary data. The API says I should have a ...