2012-02-15 78 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