On Sun, Sep 27, 2009 at 18:14, Martin Gainty <[email protected]> wrote:
> could someone determine if checking contentType to determine RESTRequest is
> sufficient?
>
> org.apache.axis2.transport.http.HttpTransportUtils{
> public static final String MEDIA_TYPE_APPLICATION_XML = "application/xml";
>     public static final String MEDIA_TYPE_X_WWW_FORM =
>             "application/x-www-form-urlencoded";
>     public static final String MEDIA_TYPE_MULTIPART_FORM_DATA =
> "multipart/form-data";
>
>     public static boolean isRESTRequest(String contentType) {
>         return contentType != null &&
>
> (contentType.indexOf(HTTPConstants.MEDIA_TYPE_APPLICATION_XML) > -1 ||
>                 contentType.indexOf(HTTPConstants.MEDIA_TYPE_X_WWW_FORM) >
> -1 ||
>
> contentType.indexOf(HTTPConstants.MEDIA_TYPE_MULTIPART_FORM_DATA) > -1);
>     }
> }
> some other projects are mapping REST based on URL parse(and not necessarily
> contentType test)

I'm not an expert, but I would say that RESTfulness is a property of
the service, not the message. This implies that one can determine
whether a request is REST or not only after dispatching to the service
(based on the URL). I don't know why in Axis2, we try to do this at
transport level.

Andreas

> does REST have a spec to follow and if so is there any parsing of URL to
> determine if this is a REST request?
>
> thanks,
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
> ________________________________
> Hotmail® has ever-growing storage! Don’t worry about storage limits. Check
> it out.

Reply via email to