使用CURL将JSON作为PUT请求传递 [英] Passing JSON as a PUT request using CURL

查看:1470
本文介绍了使用CURL将JSON作为PUT请求传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要发送PUT请求。

需要PHP代码来使用web服务并捕获PUT值并返回响应。



PHP中需要的编码。



紧急。



我被困在怎么样将json值作为put请求发送。



任何解决方案。

I need to send the PUT request.
Need PHP code for consuming the webservice and capture the PUT value and returning the response.

The coding needed in PHP.

It is urgent.

I am stuck as to how to send the json value as a put request.

Any solution.

推荐答案

if(


_SERVER [' REQUEST_METHOD' ] == ' PUT'){
parse_str(file_get_contents( php:// input),
_SERVER['REQUEST_METHOD'] == 'PUT') { parse_str(file_get_contents("php://input"),


postValue);
var_dump(
postValue); var_dump(


这篇关于使用CURL将JSON作为PUT请求传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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