C#HTTP POST和PHP
问题描述:
大家好,我有C#代码将字符串发布到URL。
我希望在我的PHP脚本中获得该值。我试过这样的东西,但PHP没有回应!。我是C#和PHP的新手。在这方面的任何帮助表示赞赏。
C#Code
string test =" test = this is a test"; (我正在使用ContentType = application / x-www-form-urlencoded)
PHP代码
$ data = $ _POST [" test"];
echo $ data;
Hi all,
I have C# code that posts a string to an URL.
I would like to get that value in my PHP script. I tried to something like this but the PHP echoed nothing!.
I'm new to C# and PHP. Any help in this regard is appreciated.
C# Code
string test = "test=this is a test"; (I'm using ContentType = application/x-www-form-urlencoded)
PHP Code
$data = $_POST["test"];
echo $data;
答
我没有看到PHP代码有什么问题,但是因为你还没有对C#代码发表评论提供了足够的代码。
I don't see anything wrong with the PHP Code but can't comment on C# code as you haven't provided sufficient code.