我有一个端点https://www ..com发送URL参数
当我做出卷曲电话,我有端点https://www ..com?参数1 =真
我想做类似Nodejs的调用,我不确定是否应该在头文件中传递param1,连接到端点或传入选项。什么是正确的做法?
我的节点JS是这样的拨打电话到我的节点服务器的AMD我的文件如下所示,
app.post('/thisway', function(req, res){
var ENDPOINT = req.body.endPoint
//(this gets me till https://<url> part of the endpoint string)
var urlToHit = ENDPOINT.concat("?param1=true")
var headers = {
'Authorization': xxxxx,
'Accept': '*/*',
'X-Spark-Service-Instance': xxxxx
}
var options= {
url: urlToHit,
headers: headers,
json: {xxxxxx}
}
request(options, callback);
}
什么是错误?始终发布错误 –
与此相关的任何内容? https://stackoverflow.com/questions/20089582/how-to-get-url-parameter-in-express-node-js?rq=1 –
这给我一个内部服务器错误,没有太多的描述。我不确定我的URL参数设置为true的方式。 –