的file_get_contents当量(QUOT; PHP://输入");在传统的ASP [英] equivalent of file_get_contents("php://input"); in classic asp
问题描述
这是它?
我想转换, $ =数据的file_get_contents(PHP://输入);
来传统的ASP ...
设置XMLHTTP =的CreateObject(MSXML2.ServerXMLHTTP.6.0)
xmlhttp.openGET,PHP://输入,假的
xmlhttp.setRequestHeader内容类型,应用程序/ x-WWW的形式urlen codeD
xmlhttp.send
TOKEN = xmlhttp.responseText
编辑:在回答约翰的问题...
实时更新
在成功认购,Facebook将继续调用
您的端点有变化(对选择的领域每一次
或连接)。对于每个更新,它将使一个HTTP POST请求。
的请求将具有内容类型application / JSON和主体的
将包括含有一种或多种变化的JSON-CN codeD字符串。
请注意PHP开发人员:在PHP中,让你可以使用EN codeD数据
以下code:
$ =数据的file_get_contents(PHP://输入);
$ JSON = json_de code($的数据);
块引用>解决方案我找到了答案。
在的ADODB.Stream传统的ASP是在PHP的file_get_contents是等效的。
我花了一段时间才能弄明白,这里是codeS为那些谁就会在未来对同一事项的斗争...
tot_bytes =方法Request.TotalBytes设置BinaryStream =的CreateObject(的ADODB.Stream)
BinaryStream.Mode = 3
BinaryStream.Type = 1
BinaryStream.Open
gBinaryData = BinaryStream.Write(tot_bytes)
BinaryStream.Close
设置BinaryStream =什么SQL =INSERT INTO STATUSES(StatusMessage,StatusDateEntered)VALUES('&放大器; gBinaryData&安培;','&放大器; FormatDateMySQL(NOW)及')
设置objAddC = objConn.execute(SQL)Is this it?
I am trying to convert,
$data = file_get_contents("php://input");
to classic asp...Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP.6.0") xmlhttp.open "GET", php://input, false xmlhttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded" xmlhttp.send TOKEN = xmlhttp.responseText
edit: Answering John's question...
Realtime Updates
Following a successful subscription, Facebook will proceed to call your endpoint every time that there are changes (to the chosen fields or connections). For each update, it will make an HTTP POST request.
The request will have content type of application/json and the body will comprise a JSON-encoded string containing one or more changes.
Note for PHP developers: In PHP, to get the encoded data you would use the following code:
$data = file_get_contents("php://input"); $json = json_decode($data);
解决方案I found out the answer.
ADODB.Stream in classic asp is the equivalent of file_get_contents in php.
Took me a while to figure it out, here are the codes for those who will struggle with the same matter in the future...
tot_bytes = Request.TotalBytes Set BinaryStream = CreateObject("ADODB.Stream") BinaryStream.Mode = 3 BinaryStream.Type = 1 BinaryStream.Open gBinaryData = BinaryStream.Write(tot_bytes) BinaryStream.Close Set BinaryStream = Nothing SQL = "INSERT INTO STATUSES (StatusMessage, StatusDateEntered) VALUES ('"& gBinaryData &"', '"& FormatDateMySQL(NOW) &"')" Set objAddC = objConn.execute(SQL)
这篇关于的file_get_contents当量(QUOT; PHP://输入");在传统的ASP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!