如何在Angular 6中通过URL调用报告

时间:2019-01-17 00:31:24

标签: http angular6 query-string

尝试通过Angular 6代码通过http调用Jasper报告,然后在Chrome中以PDF格式显示。

.net中有HttpWebResponse,用于进行调用并向请求添加标头,我们如何在Angular 6中实现等效。

HttpWebRequest request = WebRequest.Create(URL ADDRESS) 
request.Headers.Add(credentials)
request.Method = "GET";
request.ContentType = "text/xml";


HttpWebResponse response;
 using (response = request.GetResponse() as HttpWebResponse)
{
 // Get the response stream  
StreamReader reader = new 
StreamReader(response.GetResponseStream(), Encoding.UTF8);
                    StreamReader reader = new 
StreamReader(response.GetResponseStream());
                    results = reader.ReadToEnd();
}

0 个答案:

没有答案