如何在.net服务器端检索Http请求参数
How to retrieve Http Request parameters on .NET server side
我已经使用XmlHttpRequest调用了。net DLL(类库项目):
function httpGet(theUrl, sendParam) {
var xmlHttp = null;
xmlHttp = new XMLHttpRequest();
xmlHttp.open('POST', theUrl, false);
xmlHttp.setRequestHeader('Content-Type', 'text/xml');
xmlHttp.send(sendParam);
var strHtml = xmlHttp.responseText;
xmlHttp = null; // always clear the XmlHttp object when you are done to avoid memory leaks
return strHtml;
}
我如何在服务器端检索使用上述请求的。send()方法发送的参数?
附加信息:
基本上在Sage CRM中,它调用浏览器中的DLL (eware.dll)来呈现Sage CRM页面的输出。如果我们想调用自定义服务器端程序集,我们必须在查询字符串中提供DLL名称和方法名称,如:http://localhost/installname/eware.dll?SID=xxxxx&Act=123&dotnetdll=dllname&dotnetfunc=methodname
。所以问题是在这种情况下。
后来我找到了使用Sage CRM .NET API检索服务器端(库项目/DLL)上的querystring参数的方法,但是如果我们能够检索服务器端库项目(DLL)中的xmlHttpRequest.send()参数,我们仍然徘徊?
我用下面的方法制作了你想要的东西:
var request = new XMLHttpRequest();
request.responseType = "blob";
request.open("GET", '/Reports/Report1?type=myParam');
request.onload = function () {
var url = window.URL.createObjectURL(this.response);
var a = document.createElement("a");
document.body.appendChild(a);
a.href = url;
a.download = this.response.name || "Mensajes" + $.now()
a.click();
}
request.send();
$scope.procesando = true;
$scope.procesando = false;
服务器端:
[HttpGet]
public FileStreamResult Report1()
{
string tipo = Request.QueryString["type"];
...
...
...
}
希望对你有帮助。
相关文章:
- Meteor如何接收HTTP请求
- 在我的情况下,如何进行http请求
- 使用插件收听Firefox标签的http请求
- http请求使用html而不是json进行响应
- 在node-js路由中发出http请求
- 是否可以在没有HTTP请求或<输入>
- Acync JS HTTP请求通知请求
- PhantomJs在控制台中发出http请求时不会返回任何状态
- PHP处理来自一个页面的http请求,并将其显示在另一个页面上
- Firefox插件-如何发出http请求
- 验收测试主要针对传出的http请求
- 验证HTTP请求来自NFC标签上的点击
- 如何制作'http请求'在Node js中同步
- 为什么我在Cloud9中的http请求总是返回错误
- AngularJS Typeahead和$http请求限制
- HTTP请求使用cURL,但在浏览器中使用javascript时会得到CORS响应
- 如何使用Chrome扩展API获取网页的所有HTTP请求
- 将http请求中的数据传递给C#控制器
- 在初始化路由之前发送$http请求
- 从客户端捕获 HTTP 请求(包括 ajax)