線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:2022
推到 Plurk!
推到 Facebook!

IdHttp DoRequest hmDelete

缺席
jasonma168
一般會員


發表:39
回覆:33
積分:14
註冊:2002-05-24

發送簡訊給我
#1 引用回覆 回覆 發表時間:2012-01-31 17:20:32 IP:223.138.xxx.xxx 訂閱
我在Delphi 7, Indy 9

下 IdHttp.DoRequest(hmPut, URL, ASource, AResponseContent),沒有問題,

但是下 IdHttp.DoRequest(hmDelete, URL, ASource, AResponseContent),

回應<!--[if gte mso 9]><xml> Normal 0 0 2 false false false MicrosoftInternetExplorer4 </xml><![endif]--><!--[if gte mso 9]><xml> </xml><![endif]--><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:表格內文; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> </xml><![endif]--><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:表格內文; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'

請問是什麼問題?怎麼解決?



GrandRURU
站務副站長


發表:240
回覆:1680
積分:1874
註冊:2005-06-21

發送簡訊給我
#2 引用回覆 回覆 發表時間:2012-01-31 22:59:56 IP:111.249.xxx.xxx 訂閱
你的Server有提供Delete的方法嗎?
另外,有刪除的權限嗎?

===================引 用 jasonma168 文 章===================
我在Delphi 7, Indy 9

下 IdHttp.DoRequest(hmPut, URL, ASource, AResponseContent),沒有問題,

但是下 IdHttp.DoRequest(hmDelete, URL, ASource, AResponseContent),

回應<!--[if gte mso 9]><xml><br /> Normal 0 0 2 false false false MicrosoftInternetExplorer4

</xml><![endif]--><!--[if gte mso 9]><xml><br />

</xml><![endif]--><!--[if gte mso 10]>
<style><br /> /* Style Definitions */
table.MsoNormalTable {mso-style-name:表格內文; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;}
</style><br />

</xml><![endif]--><!--[if gte mso 10]>
<style><br /> /* Style Definitions */
table.MsoNormalTable {mso-style-name:表格內文; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;}
</style><br />
請問是什麼問題?怎麼解決?



編輯記錄
GrandRURU 重新編輯於 2012-01-31 08:01:06, 註解 無‧
jasonma168
一般會員


發表:39
回覆:33
積分:14
註冊:2002-05-24

發送簡訊給我
#3 引用回覆 回覆 發表時間:2012-02-01 09:55:56 IP:223.138.xxx.xxx 訂閱
Web Team 的說有,而且沒有問題。

GrandRURU 大大,您有用過 DoRequest 做 Delete 是嗎?

===================引 用 GrandRURU 文 章===================
你的Server有提供Delete的方法嗎?
另外,有刪除的權限嗎?




GrandRURU
站務副站長


發表:240
回覆:1680
積分:1874
註冊:2005-06-21

發送簡訊給我
#4 引用回覆 回覆 發表時間:2012-02-01 10:09:39 IP:59.120.xxx.xxx 訂閱
沒有,我也只是道聽塗說

http://www.danysoft.com/free/Delphi_2010_REST_WP_Marco_Cantu_0911.pdf

搜尋「DoRequest」,有一段可以參考一下
if (methodAttr = 'delete') then
begin
resStream := TStringStream.Create ('');
try
IdHttp.DoRequest (hmDelete, fromAttr, nil, resStream);
finally
resStream.Position := 0;
res := resStream.DataString;
resStream.Free;
end;
end

===================引 用 jasonma168 文 章===================
Web Team 的說有,而且沒有問題。

GrandRURU 大大,您有用過 DoRequest 做 Delete 是嗎?



jasonma168
一般會員


發表:39
回覆:33
積分:14
註冊:2002-05-24

發送簡訊給我
#5 引用回覆 回覆 發表時間:2012-02-02 10:16:20 IP:114.136.xxx.xxx 訂閱
我改用 TEIHTTPSClient 解決了!
推薦 TEIHTTPSClient,不會亂彈一些訊息,回傳的 Integer 就是 http 的狀態碼。
系統時間:2024-04-27 7:46:59
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!