开发者

posting data to a site in C#

i'm flabbergasted,

i've looked at almost every example, but it just doesn't work (the other party says they don't receive my data in the request parameter)

I want to do this in code (send some xml data (without the xml declaration) to a uri):

<form method="post" action="http://100.100.100.100:11111/getinfo">

<input type="text" value="<ps:Balance>100</ps:Balance>" name="request" id="request">
<br><br>
<input type="submit" value="go">
</form>

EDIT the double http was a typo

EDIT 2: i obviously wasn't very clear in my hurry to ask the question: what i typed here is HTML, and when i open that html in IE and 开发者_运维知识库click the submit button, i get a reply from the server that the data (with the name 'request') was received. But now i want to get the same result in my C# code: post this string "100 as post-value and 'request' as post-key to the action uri.


Why do you have http:// twice? http://http://100.100.100.100:11111/getinfo ?


Ignoring the double http:, you are not in anyway using c#, that is just an html form. Unless something like a proxy is stripping out your data, it must be posting to the URL, you HTML is too simple for it not to be. Perhaps you have named the form field incorectly. If you use something like fiddler you can inspect the raw request and response, all the posted variables, http headers everything. You can then see exactly what is being posted to the uri.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜