如何获得来自Apache HTTPS服务器端通过脚本HTTPS POST请求的内容 [英] How to get content of a https post request from Apache https server side via script

查看:187
本文介绍了如何获得来自Apache HTTPS服务器端通过脚本HTTPS POST请求的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有使用的libcurl通过HTTPS发送XML数据包发送到Apache服务器C客户端。

I have a C client which use libcurl to send xml packet to Apache server via HTTPS.

作为客户端code的某些部分:

some parts of the client code as:

curl_easy_init();

curl_easy_init();

curl_easy_setopt(卷曲,CURLOPT_URL,https://example.com/test.php);

curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/test.php");

curl_easy_setopt(卷曲,CURLOPT_POSTFIELDS,send_buf);

curl_easy_setopt(curl, CURLOPT_POSTFIELDS, send_buf);

curl_easy_setopt(卷曲,CURLOPT_POSTFIELDSIZE,strlen的(send_buf));

curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, strlen(send_buf));

curl_easy_setopt(卷曲,CURLOPT_POST,1L);

curl_easy_setopt(curl, CURLOPT_POST, 1L);

解析度= curl_easy_perform(卷曲);

res = curl_easy_perform(curl);

send_buf的内容发送到HTTPS Apache服务器(https://example.com/test.php),但在Apache服务器端,我该如何使用test.php的获得send_buf的内容?任何其他脚本都欢迎。谢谢

The content of send_buf is sent to https apache server (https://example.com/test.php), but on the Apache server side, how can I use test.php to get the content of send_buf? Any other scripts are welcome. thanks

任何例如codeS?

Any example codes?

推荐答案

我可能是有点不清楚你的问题,但我假设send_buf是标准格式,即

I may be a little unclear on your question, but I'm assuming send_buf is in the standard format, ie,

富=酒吧和放大器;巴兹=嘘声和放大器; X = 17 +猫+等

foo=bar&baz=boo&x=17+cats+etc

在这种情况下,在接收PHP脚本(test.php的)在$ _ POST变量将如下初始化:

In that case, in your receiving PHP script (test.php) the $_POST variable will be initialized as follows:

$_POST['foo'] = "bar"
$_POST['baz'] = "boo"
$_POST['x'] = "17 cats etc"

因此​​,你可以通过访问一个价值$ _ POST ['富'。

So you can access a value by using $_POST['foo'].

希望有所帮助。

这篇关于如何获得来自Apache HTTPS服务器端通过脚本HTTPS POST请求的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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