如何通过HttpWebRequest或Response向请求的响应返回值 [英] how to return a value to the requested Response via HttpWebRequest or Response

查看:75
本文介绍了如何通过HttpWebRequest或Response向请求的响应返回值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我对asp .net weResponse有问题.

我正在构建从其他应用程序接受HttpWebRequest的应用程序.这将计算所有计算结果,并将某些值返回给该请求的应用程序.我做到了,但是那个接收应用程序,接收了包括结果在内的所有html内容.我只想返回那个生成的值.

我该怎么做才能只将计算出的值返回给请求的应用程序.

谢谢...

hi to all.,

i have a problem with asp .net weResponse.

i am building application that accept the HttpWebRequest from some other application. That will calculate all the calculations and returns the some value to that requested application. I done it but that receiving application, receiving all the html content including the result. I want to return only that generated value.

how do i do that to return only that calculated value to the requested application..??


thanks...

推荐答案

WebRequest request = WebRequest.Create("url"); //url pass gere
Web响应响应= request.GetResponse();
流receiveStream = response.GetResponseStream();
StreamReader readStream =新的StreamReader(receiveStream,Encoding.UTF8);
字符串responseText = readStream.ReadToEnd();
readStream.Close();
response.Close();
WebRequest request = WebRequest.Create("url"); //url pass gere
WebResponse response = request.GetResponse();
Stream receiveStream = response.GetResponseStream();
StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);
string responseText = readStream.ReadToEnd();
readStream.Close();
response.Close();


这篇关于如何通过HttpWebRequest或Response向请求的响应返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆