Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从c#类调用json时权限被拒绝_C#_Json - Fatal编程技术网

从c#类调用json时权限被拒绝

从c#类调用json时权限被拒绝,c#,json,C#,Json,我试图从c类库调用json,下面是我正在使用的代码。在浏览器中访问jsonurl时,我能够看到相应的数据。但是从代码中,它给出了您没有权限调用此URL 请帮助我们如何克服这个错误 节目: 网址: 字符串url=https://landfill.bugzilla.org/bugzilla-tip/jsonrpc.cgi?method=Product.get¶ms=[{“id”:“4”}] 你做的是“获取”而不是帖子,对吗 更改此项: webRequest.Method = "POST";

我试图从
c
类库调用
json
,下面是我正在使用的代码。在浏览器中访问
json
url时,我能够看到相应的数据。但是从代码中,它给出了您没有权限调用此URL

请帮助我们如何克服这个错误

节目

网址:

字符串url=https://landfill.bugzilla.org/bugzilla-tip/jsonrpc.cgi?method=Product.get¶ms=[{“id”:“4”}]

你做的是“获取”而不是帖子,对吗

更改此项:

webRequest.Method = "POST";


当我将此更改为get时,我得到了类似“无法发送此动词类型的内容正文”的执行选项。删除了post数据部分,现在工作正常:)非常感谢。您能告诉我如何在Json中传递参数吗?
webRequest.Method = "POST";
webRequest.Method = "GET";