Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to transfer curl to php

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how curl to php, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to understand it!

The method of converting curl to php: 1. Through "curl-X GET-H" Content-Type:application "..." Get the status; 2, set the status; 3, through "$header= array (...)" Method it can be sent from curl to php.

This article operating environment: windows7 system, PHP7.1 version, DELL G3 computer

How to transfer curl to PHP?

Curl command is converted to php source code

Get status:

Curl-X GET-H "Content-Type:application/json"-H "Authorization: token 4e56266f2502936e0378ea6a985dc74a5bec4280" http://user.endv.cn/v1/datastreams/plug-status/datapoint/

Return

{"status": 200, "datapoint": null}

Set statu

Curl-H "Authorization: token 6bcb3cdb69b07370f5ad73e7a856409802fdd735"-d "{\" datapoint\ ": {\" x\ ": 1}}" http://user.endv.cn/v1/datastreams/plug-status/datapoint/?deliver_to_device=true

Return

{"status": 404, "nonce": 333984364, "message": "remote device is disconnect"}

Send from curl to php

Get status:

Set status:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report