2012-02-15 79 views
1

我想在C#中製作一個程序,該程序將/登錄並在網站上進行操作。我使用Fiddler來查看我應該使用哪個網址。URL POST參數

所以,在提琴手我寫:

https://landfill.bugzilla.org/bugzilla-tip/[email protected]&Bugzilla_password=mypassword&product=WorldControl&version=1.0&component=WeatherControl&rep_platform=All&op_sys=All&priority=P2&bug_severity=normal&target_milestone=World 202.0&bug_status=CONFIRMED&[email protected]&short_desc=bla 

,我和POST發送。我收到一條消息,內容是:「您確定要確認是否要進行這些更改嗎?這可能會導致意外和不期望的結果。」

然後,有一個按鈕說'確認更改'。它在結果頁面的HTML代碼是:

<form name="check" id="check" method="post" action="post_bug.cgi"> 
    <input type="hidden" name="product" 
     value="WorldControl"> 
    <input type="hidden" name="version" 
     value="1.0"> 
    <input type="hidden" name="component" 
     value="WeatherControl"> 
    <input type="hidden" name="rep_platform" 
     value="All"> 
    <input type="hidden" name="op_sys" 
     value="All"> 
    <input type="hidden" name="priority" 
     value="P2"> 
    <input type="hidden" name="bug_severity" 
     value="normal"> 
    <input type="hidden" name="target_milestone" 
     value="World 2.0"> 
    <input type="hidden" name="bug_status" 
     value="CONFIRMED"> 
    <input type="hidden" name="assigned_to" 
     value="mymail&#64;hotmail.com"> 
    <input type="hidden" name="short_desc" 
     value="bla"> 
    <input type="hidden" name="token" 
     value="aGipS2Hfim"> 
<input type="submit" id="confirm" value="Confirm Changes"> 

我應該寫爲URL的提琴手或在瀏覽器中點擊這個按鈕確認?

+0

您可以使用JavaScript來做到這一點。例如,如果您想在網站上發送第一個表單,則可以使用表單集合表單[0] .submit()。但我認爲這會發送表單輸入的數據。 – designerrr 2012-02-15 08:45:56

+0

@designerr這不是一個Web應用程序。我不能使用JS。 – 2012-02-15 08:50:58

+0

@designerrr這不是一個Web應用程序。我不能使用JS。 – 2012-02-15 09:16:08

回答

0

問題是參數不應該在URL中。這不是GET方法。

0

您應該提交POST數據到URL https://landfill.bugzilla.org/bugzilla-tip/post_bug.cgi

POST數據應該如下:

版本= 1.2 &元器件= WeatherControl & ....等

不要忘記編碼POST數據和設置內容類型爲「application/x軸WWW的形式,進行了urlencoded」

UPDATE:當您收到第一個答案與確認鍵,解析它的DOM,並再次提交給同URL.This應該表現一樣的,你點擊確認按鈕

+0

我正在通過我在我的問題中編寫的URL提交POST數據。問題是,我得到的結果有一個按鈕「確認」,我需要按下。應該是我的網址 – 2012-02-15 08:50:09

+0

韋爾的網址是一樣的,我已經輸入 – 2012-02-15 09:02:42

+0

這意味着它不起作用。 – 2012-02-15 09:03:28