C#HTTP POST和PHP [英] C# HTTP POST and PHP

查看:98
本文介绍了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.


这篇关于C#HTTP POST和PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆