使用不带表单的后置方法发送数据 [英] Sending Data Using Post Method Without Form

查看:247
本文介绍了使用不带表单的后置方法发送数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想发送数据到API,数据包括简单的变量用户名,pasword,电子邮件等。
现在的问题是这是我想使用POST方法发送数据到这个问题,我在google上搜索这个问题,每个人都说去CURL。



现在什么是curl?它是一个函数,脚本,api或什么?



有其他方法吗?



我想发送类似这样的

  $ username,$ password到www.abc.com?username=$username&password= $ password 

最好的方法

方案

cURL是一个库,允许您连接和沟通许多不同类型的服务器与许多不同类型的协议。因此,您可以使用cURL发送HTTP POST请求。有关详细信息,请阅读PHP手册: http://www.php.net/ manual / en / book.curl.php



但是cURL不是唯一的答案。您可以使用 PHP Streams ,甚至可以使用套接字函数连接到网络服务器,然后生成您的请求。 p>

我个人经常使用cURL,因为它非常灵活,可以轻松处理cookie。


I want to send data to an API, data include simple variables username, pasword, email etc. Now problem is this that i want to send data to this using POST method, i searched this issue on google, every one is saying go for CURL.

Now What is curl? is it a function, script, api or what?

Is there any other way to do it?

i want to send something like this

$username, $password to www.abc.com?username=$username&password=$password

Best Regards

解决方案

cURL is a library "that allows you to connect and communicate to many different types of servers with many different types of protocols". So you can use cURL to send an HTTP POST request. Please read the PHP manual for detailed information: http://www.php.net/manual/en/book.curl.php

But cURL is not the only answer. You can use PHP Streams, or even connect to the webserver using socket functions and then generate your requests.

Personally I often use cURL because it's very flexible and you can work with cookies easily.

这篇关于使用不带表单的后置方法发送数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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