You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Christofer Dutz <ch...@c-ware.de> on 2015/09/07 14:56:43 UTC
Allowing PUT and DELETE requests in HTTPService
Hi,
I am currently working on a fun project in which we are having a little battle of the client technologies. The backend server is a REST service communicating in JSON.
While my Flex client is currently way beyond the others, I just stumbled over a problem which I don't quite know how to work around.
The problem is that the REST service accepts GET, PUT, DELETE and POST requests. I was pretty surprised to find out the Flex doesn't seem to support PUT and DELETE. The reasoning behind this seems to be related with Browsers not supporting these. Is this still the case? I think a lot of the modern JSFrameworks make heavy usage of REST services. Anyway I am creating an AIR application, so I don't care about browsers anyway.
Is there a way around this to make REST PUT and DELETE calls possible? I have tried the URLRequest approach, but this doesn't seem to work.
Is this a restriction from the dark ages and we could make Flex work with PUT and DELETE or is this a restriction of the Flashplayer or AIR runtime?
Chris
Re: Allowing PUT and DELETE requests in HTTPService
Posted by Nicholas Kwiatkowski <ni...@gmail.com>.
This is a restriction of the native http client within AFP stack (Flash
Player and AIR). It only supports POST and GET.
The work-around is to use a 3rd party HTTP client within your app.
Essentially, a client that builds its own HTTP header and then passes it
along. There are quite a few libraries out there that can do this -- none
that I'd recommend one over the other.
-Nick
On Mon, Sep 7, 2015 at 8:56 AM, Christofer Dutz <ch...@c-ware.de>
wrote:
> Hi,
>
>
> I am currently working on a fun project in which we are having a little
> battle of the client technologies. The backend server is a REST service
> communicating in JSON.
>
> While my Flex client is currently way beyond the others, I just stumbled
> over a problem which I don't quite know how to work around.
>
>
> The problem is that the REST service accepts GET, PUT, DELETE and POST
> requests. I was pretty surprised to find out the Flex doesn't seem to
> support PUT and DELETE. The reasoning behind this seems to be related with
> Browsers not supporting these. Is this still the case? I think a lot of the
> modern JSFrameworks make heavy usage of REST services. Anyway I am creating
> an AIR application, so I don't care about browsers anyway.
>
>
> Is there a way around this to make REST PUT and DELETE calls possible? I
> have tried the URLRequest approach, but this doesn't seem to work.
>
>
> Is this a restriction from the dark ages and we could make Flex work with
> PUT and DELETE or is this a restriction of the Flashplayer or AIR runtime?
>
>
> Chris
>
Re: AW: Allowing PUT and DELETE requests in HTTPService
Posted by chechoportnoy <ch...@hotmail.com>.
This works! Thanks!
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/Allowing-PUT-and-DELETE-requests-in-HTTPService-tp49018p56414.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.
AW: Allowing PUT and DELETE requests in HTTPService
Posted by Christofer Dutz <ch...@c-ware.de>.
Well I solved my problem by using Springs HiddenHttpMethodFilter
This monitors incoming requests for "_method" parameters and allows to override them. So I was able to fake a PUT by adding "?_method=PUT" and a DELETE by adding "?_method=DELETE" to my rest url ... it's not nice, but it works.
Chris
________________________________________
Von: omuppi1@gmail.com <om...@gmail.com> im Auftrag von OmPrakash Muppirala <bi...@gmail.com>
Gesendet: Montag, 7. September 2015 21:10
An: dev@flex.apache.org
Betreff: Re: Allowing PUT and DELETE requests in HTTPService
The problem with socket based http clients are that they bypass the browser
completely and hence the browser cache. It hits you really for those GETs
you want cache working for.
Thanks,
Om
On Sep 7, 2015 10:16 AM, "Harbs" <ha...@gmail.com> wrote:
> I believe Socket based HTTP Clients can do this. There’s a couple out
> there. [1][2].
>
> The author of the first seems to recommend the second.[3]
> [1]https://code.google.com/p/as3httpclient/
> [2] https://github.com/gabriel/as3httpclient
> [3]
> http://www.abdulqabiz.com/blog/archives/2008/01/21/as3httpclientlib-a-better-http-client-in-actionscript-by-gabe/
>
> On Sep 7, 2015, at 3:56 PM, Christofer Dutz <ch...@c-ware.de>
> wrote:
>
> > Hi,
> >
> >
> > I am currently working on a fun project in which we are having a little
> battle of the client technologies. The backend server is a REST service
> communicating in JSON.
> >
> > While my Flex client is currently way beyond the others, I just stumbled
> over a problem which I don't quite know how to work around.
> >
> >
> > The problem is that the REST service accepts GET, PUT, DELETE and POST
> requests. I was pretty surprised to find out the Flex doesn't seem to
> support PUT and DELETE. The reasoning behind this seems to be related with
> Browsers not supporting these. Is this still the case? I think a lot of the
> modern JSFrameworks make heavy usage of REST services. Anyway I am creating
> an AIR application, so I don't care about browsers anyway.
> >
> >
> > Is there a way around this to make REST PUT and DELETE calls possible? I
> have tried the URLRequest approach, but this doesn't seem to work.
> >
> >
> > Is this a restriction from the dark ages and we could make Flex work
> with PUT and DELETE or is this a restriction of the Flashplayer or AIR
> runtime?
> >
> >
> > Chris
>
>
Re: Allowing PUT and DELETE requests in HTTPService
Posted by OmPrakash Muppirala <bi...@gmail.com>.
The problem with socket based http clients are that they bypass the browser
completely and hence the browser cache. It hits you really for those GETs
you want cache working for.
Thanks,
Om
On Sep 7, 2015 10:16 AM, "Harbs" <ha...@gmail.com> wrote:
> I believe Socket based HTTP Clients can do this. There’s a couple out
> there. [1][2].
>
> The author of the first seems to recommend the second.[3]
> [1]https://code.google.com/p/as3httpclient/
> [2] https://github.com/gabriel/as3httpclient
> [3]
> http://www.abdulqabiz.com/blog/archives/2008/01/21/as3httpclientlib-a-better-http-client-in-actionscript-by-gabe/
>
> On Sep 7, 2015, at 3:56 PM, Christofer Dutz <ch...@c-ware.de>
> wrote:
>
> > Hi,
> >
> >
> > I am currently working on a fun project in which we are having a little
> battle of the client technologies. The backend server is a REST service
> communicating in JSON.
> >
> > While my Flex client is currently way beyond the others, I just stumbled
> over a problem which I don't quite know how to work around.
> >
> >
> > The problem is that the REST service accepts GET, PUT, DELETE and POST
> requests. I was pretty surprised to find out the Flex doesn't seem to
> support PUT and DELETE. The reasoning behind this seems to be related with
> Browsers not supporting these. Is this still the case? I think a lot of the
> modern JSFrameworks make heavy usage of REST services. Anyway I am creating
> an AIR application, so I don't care about browsers anyway.
> >
> >
> > Is there a way around this to make REST PUT and DELETE calls possible? I
> have tried the URLRequest approach, but this doesn't seem to work.
> >
> >
> > Is this a restriction from the dark ages and we could make Flex work
> with PUT and DELETE or is this a restriction of the Flashplayer or AIR
> runtime?
> >
> >
> > Chris
>
>
Re: Allowing PUT and DELETE requests in HTTPService
Posted by Harbs <ha...@gmail.com>.
I believe Socket based HTTP Clients can do this. There’s a couple out there. [1][2].
The author of the first seems to recommend the second.[3]
[1]https://code.google.com/p/as3httpclient/
[2] https://github.com/gabriel/as3httpclient
[3]http://www.abdulqabiz.com/blog/archives/2008/01/21/as3httpclientlib-a-better-http-client-in-actionscript-by-gabe/
On Sep 7, 2015, at 3:56 PM, Christofer Dutz <ch...@c-ware.de> wrote:
> Hi,
>
>
> I am currently working on a fun project in which we are having a little battle of the client technologies. The backend server is a REST service communicating in JSON.
>
> While my Flex client is currently way beyond the others, I just stumbled over a problem which I don't quite know how to work around.
>
>
> The problem is that the REST service accepts GET, PUT, DELETE and POST requests. I was pretty surprised to find out the Flex doesn't seem to support PUT and DELETE. The reasoning behind this seems to be related with Browsers not supporting these. Is this still the case? I think a lot of the modern JSFrameworks make heavy usage of REST services. Anyway I am creating an AIR application, so I don't care about browsers anyway.
>
>
> Is there a way around this to make REST PUT and DELETE calls possible? I have tried the URLRequest approach, but this doesn't seem to work.
>
>
> Is this a restriction from the dark ages and we could make Flex work with PUT and DELETE or is this a restriction of the Flashplayer or AIR runtime?
>
>
> Chris
Re: AW: Allowing PUT and DELETE requests in HTTPService
Posted by OmPrakash Muppirala <bi...@gmail.com>.
I believe you can solve this by proxying the calls through Javascript,
using ExternalInterface as well.
Thanks,
Om
On Sep 7, 2015 6:45 AM, "Krüger, Olaf" <OK...@edscha.com> wrote:
> Hi,
> I ran into the same problem, here's a (very old) summary of the problem:
> http://verveguy.blogspot.de/2008/07/truth-about-flex-httpservice.html
>
> I've found these workarounds:
>
> 1) Using " X-HTTP-Method-Override" (Server side must support this):
>
> http://blog.arulprasad.com/2010/12/http-put-delete-from-actionscript-rest.html
> https://cambiatablog.wordpress.com/2010/08/10/287/
>
> 2) Add an additional argument e.g. "method" to your request and implement
> a "proxy service" at server side that interprets this argument and calls
> the origin REST service
> ...?_method=PUT/DELETE...
>
> Any news to this issue are very welcome ;-)
>
> Olaf
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Christofer Dutz [mailto:christofer.dutz@c-ware.de]
> Gesendet: Montag, 7. September 2015 14:57
> An: 'dev@flex.apache.org'
> Betreff: Allowing PUT and DELETE requests in HTTPService
>
> Hi,
>
>
> I am currently working on a fun project in which we are having a little
> battle of the client technologies. The backend server is a REST service
> communicating in JSON.
>
> While my Flex client is currently way beyond the others, I just stumbled
> over a problem which I don't quite know how to work around.
>
>
> The problem is that the REST service accepts GET, PUT, DELETE and POST
> requests. I was pretty surprised to find out the Flex doesn't seem to
> support PUT and DELETE. The reasoning behind this seems to be related with
> Browsers not supporting these. Is this still the case? I think a lot of the
> modern JSFrameworks make heavy usage of REST services. Anyway I am creating
> an AIR application, so I don't care about browsers anyway.
>
>
> Is there a way around this to make REST PUT and DELETE calls possible? I
> have tried the URLRequest approach, but this doesn't seem to work.
>
>
> Is this a restriction from the dark ages and we could make Flex work with
> PUT and DELETE or is this a restriction of the Flashplayer or AIR runtime?
>
>
> Chris
>
> ________________________________
>
> Edscha Holding GmbH
> Sitz der Gesellschaft: Remscheid
> Registergericht: Wuppertal, HRB 22889
> Geschäftsführung: Francisco J. Riberas Mera, Francisco López Peña, David
> Vázquez Pascual, Torsten Greiner, Markus Kirchner, Hans-Peter Schulz und
> Volker Weiss
>
> Vertretungsberechtigt sind nur Geschäftsführer und schriftlich
> Bevollmächtigte.
>
> Solely Managing Directors or employees with a written proxy have got power
> of representation.
>
> Der Inhalt dieser E-Mail einschließlich etwaiger beigefügter Dateien ist
> vertraulich und nur für den Empfänger bestimmt. Sollten Sie nicht der
> bestimmungsgemäße Empfänger sein, ist Ihnen jegliche Offenlegung,
> Vervielfältigung, Weitergabe oder Nutzung des Inhalts untersagt. Bitte
> informieren Sie in diesem Fall unverzüglich den Absender und löschen Sie
> die E-Mail einschließlich etwaiger beigefügter Dateien von Ihrem System.
> Vielen Dank.
>
> The contents of this e-mail including any attachments are confidential and
> may be legally privileged. If you are not the intended recipient, any
> disclosure, copying, distribution or use of its contents is strictly
> prohibited, and you should please notify the sender immediately and then
> delete this e-mail including any attachments from your system. Thank you.
>
AW: Allowing PUT and DELETE requests in HTTPService
Posted by Krüger,
Olaf <OK...@edscha.com>.
Hi,
I ran into the same problem, here's a (very old) summary of the problem:
http://verveguy.blogspot.de/2008/07/truth-about-flex-httpservice.html
I've found these workarounds:
1) Using " X-HTTP-Method-Override" (Server side must support this):
http://blog.arulprasad.com/2010/12/http-put-delete-from-actionscript-rest.html
https://cambiatablog.wordpress.com/2010/08/10/287/
2) Add an additional argument e.g. "method" to your request and implement a "proxy service" at server side that interprets this argument and calls the origin REST service
...?_method=PUT/DELETE...
Any news to this issue are very welcome ;-)
Olaf
-----Ursprüngliche Nachricht-----
Von: Christofer Dutz [mailto:christofer.dutz@c-ware.de]
Gesendet: Montag, 7. September 2015 14:57
An: 'dev@flex.apache.org'
Betreff: Allowing PUT and DELETE requests in HTTPService
Hi,
I am currently working on a fun project in which we are having a little battle of the client technologies. The backend server is a REST service communicating in JSON.
While my Flex client is currently way beyond the others, I just stumbled over a problem which I don't quite know how to work around.
The problem is that the REST service accepts GET, PUT, DELETE and POST requests. I was pretty surprised to find out the Flex doesn't seem to support PUT and DELETE. The reasoning behind this seems to be related with Browsers not supporting these. Is this still the case? I think a lot of the modern JSFrameworks make heavy usage of REST services. Anyway I am creating an AIR application, so I don't care about browsers anyway.
Is there a way around this to make REST PUT and DELETE calls possible? I have tried the URLRequest approach, but this doesn't seem to work.
Is this a restriction from the dark ages and we could make Flex work with PUT and DELETE or is this a restriction of the Flashplayer or AIR runtime?
Chris
________________________________
Edscha Holding GmbH
Sitz der Gesellschaft: Remscheid
Registergericht: Wuppertal, HRB 22889
Geschäftsführung: Francisco J. Riberas Mera, Francisco López Peña, David Vázquez Pascual, Torsten Greiner, Markus Kirchner, Hans-Peter Schulz und Volker Weiss
Vertretungsberechtigt sind nur Geschäftsführer und schriftlich Bevollmächtigte.
Solely Managing Directors or employees with a written proxy have got power of representation.
Der Inhalt dieser E-Mail einschließlich etwaiger beigefügter Dateien ist vertraulich und nur für den Empfänger bestimmt. Sollten Sie nicht der bestimmungsgemäße Empfänger sein, ist Ihnen jegliche Offenlegung, Vervielfältigung, Weitergabe oder Nutzung des Inhalts untersagt. Bitte informieren Sie in diesem Fall unverzüglich den Absender und löschen Sie die E-Mail einschließlich etwaiger beigefügter Dateien von Ihrem System. Vielen Dank.
The contents of this e-mail including any attachments are confidential and may be legally privileged. If you are not the intended recipient, any disclosure, copying, distribution or use of its contents is strictly prohibited, and you should please notify the sender immediately and then delete this e-mail including any attachments from your system. Thank you.