Skip to content
fernandezpablo85 edited this page Sep 14, 2010 · 2 revisions

Why Scribe uses custom Request & Response objects?

Java HTTP Request and Response objects SUCK. Period.

You might agree or disagree with me, but, truth be told, If I had to sign native Java request objects Scribe would be twice as big and therefore twice as hard to change (The easiest line of code to maintain is the one you never have to write in the first place).

So I have to migrate my existing code to use your Request objects? Are you kidding?

First of all, if you really can make the changes and use this objects… why don’t you give them a try? the interface is so much simple than the Java ones, and you might end liking them :)

On the other hand, if you are really stuck with using Java Request and Response objects, you can try one of the Request Wrappers Scribe provides.

Right now the available ones are:

These classes have a single static method called wrap that takes the Java .net or Servlet request and transforms it into a org.scribe.http.Request that you can freely use with the library.

Other wrappers?

I’m planning to include even more wrappers, but if you are in a hurry, file a ticket or even better, code it and contribute it so everyone else can benefit. And thanks in advance!