Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用ASP Classic将JSON数据发送到xmlhttp请求_Json_Curl_Asp Classic - Fatal编程技术网

使用ASP Classic将JSON数据发送到xmlhttp请求

使用ASP Classic将JSON数据发送到xmlhttp请求,json,curl,asp-classic,Json,Curl,Asp Classic,我需要使用POST方法和json编码的数据发送CURL请求。我是一名PHP开发人员,我知道如何在PHP中进行开发。但是在ASP经典版中,我面临着一些问题。我创建了JSON数据,使用 {"apikey":"xxxxxxxx","id":"xxxxx","email":{"email":"myemail@email.com"},"merge_vars":{"fname":"BOB","phone":"xxxxx"},"email_type":"html","double_option":false}

我需要使用POST方法和
json编码的数据发送CURL请求。我是一名
PHP
开发人员,我知道如何在
PHP
中进行开发。但是在ASP经典版中,我面临着一些问题。我创建了JSON数据,使用

{"apikey":"xxxxxxxx","id":"xxxxx","email":{"email":"myemail@email.com"},"merge_vars":{"fname":"BOB","phone":"xxxxx"},"email_type":"html","double_option":false}
dim xmlhttp 
set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST","https://someurl.com",false
xmlhttp.setRequestHeader"Content-Type", "application/json; charset=UTF-8"
xmlhttp.send data
getHTML = xmlHttp.responseText
response.write(getHTML)
xmlHttp.abort()
set xmlHttp = Nothing 
我的ASP代码看起来像

{"apikey":"xxxxxxxx","id":"xxxxx","email":{"email":"myemail@email.com"},"merge_vars":{"fname":"BOB","phone":"xxxxx"},"email_type":"html","double_option":false}
dim xmlhttp 
set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST","https://someurl.com",false
xmlhttp.setRequestHeader"Content-Type", "application/json; charset=UTF-8"
xmlhttp.send data
getHTML = xmlHttp.responseText
response.write(getHTML)
xmlHttp.abort()
set xmlHttp = Nothing 
我发现以下错误

msxml3.dll error '80004002'
No such interface supported
/asptesting/curl.asp, line 48 
48行表示
xmlhttp.send data
。当我像这样使用最新版本的
MSXML

set xmlhttp = server.Createobject("MSXML2.XMLHTTP.3.0")
我发现如下错误

msxml3.dll error '80070057'
The parameter is incorrect.
/asptesting/curl.asp, line 48 

如果有任何帮助,我们将不胜感激。

与同一用户的另一个未回答问题相关。@Lankymart如果用户的问题未得到回答,该怎么办?顺便说一句,这有点不同。我同意这有点不同,这是否意味着你的最后一个问题不再相关?如果是这样的话,考虑一下自己给别人留下一个答案。也是为了回答您的第一个问题。不确定为什么要让服务器端执行xmlHTTP请求。如果请求和响应都属于同一个域,为什么不使用AJAX呢?它更快、异步(无需重新加载页面),而且更易于处理(IMPOV)。信息:@EricWu亲爱的读了这个问题。他需要发送一个卷发请求。他在任何地方都没有提到他正在向同一个URL发送请求。当某人谈论
CURL
时,表示他正在向其他域发送请求。