如何在 Flex 中发送 PUT HTTP 请求 [英] How to send PUT HTTP Request in Flex

查看:37
本文介绍了如何在 Flex 中发送 PUT HTTP 请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在一个 URL 上发送 HTTP PUT 请求,以通过使用 API 更新 XML 的内容.

I want to send HTTP PUT Request on one URL to update that content of XML via using API.

网址是这样的:https://domainname.com/someurls/id.xml

我想更新那个内容.

但是当我发送这个 PUT 请求时,我在 Flex 4 的网络监视器中看到,它作为这个网络上的 POST 请求,而我在 HTTPService 变量中将方法设置为 PUT.

But When I am sending this PUT request, I have seen that in Network Monitor of Flex 4, Its going as the POST request on this web, while I am setting method as PUT in HTTPService variable.

所以我遇到了错误.那么有没有办法在网络上发送 PUT 请求?或者是否有任何特殊的标题来设置 PUT 方法?我试过方法头,但它不工作....

So I am getting error. So is there any way to send the PUT request on the web ? Or Is there any special header to set PUT method ? I have tried method header but its not working....

请帮帮我.....

推荐答案

我已经找到了在 flex 中使用 HTTPSerivce 发送放置和删除服务的解决方案.

I have found the solution to send the put and delete service with HTTPSerivce in flex.

您只需使用服务方法 POST 再发送一个标头.

You just have to send one more header with the service method POST.

您必须在 POST 方法中发送数据并附加一个额外的标头 X-HTTP-Method-Override 和作为 PUT 或 DELETE 的值.

You have to send data in the POST method and attach one more header X-HTTP-Method-Override and the value as the PUT or DELETE.

您的服务将作为 PUT 或 DELETE 发送.

Your service will be send as PUT or DELETE.

谢谢......

这篇关于如何在 Flex 中发送 PUT HTTP 请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆