简体   繁体   English

如何使用asp.net C#通过API调用php网站

[英]how to call php website through API using asp.net C#

i am trying to call a php Api through API using asp.net c#, could anyone please help me i want to call the following API username: admin password: **** 我试图使用asp.net c#通过API调用php Api,请问有人可以帮助我,我想调用以下API用户名:管理员密码:****

http://Ip Hidden/WHMCS_1/includes/api.php

在此处输入图片说明 check the following code it throw error thanks in advance 检查以下代码它抛出错误,谢谢

This is a pretty broad question so this answer is broad too. 这是一个相当广泛的问题,所以这个答案也很广泛。

You can use the WebClient class for this: 您可以为此使用WebClient类:

Provides common methods for sending data to and receiving data from a resource identified by a URI 提供用于向URI标识的资源发送数据和从中接收数据的通用方法

WebClient Class - MSDN docs with example usage WebClient类 -具有示例用法的MSDN文档

In later versions of .net you can use: 在更高版本的.net中,您可以使用:

HttpClient class - MSDN docs with example usage HttpClient类 -具有示例用法的MSDN文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM