消费json服务 [英] consume a json service

查看:64
本文介绍了消费json服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
如何在不使用流阅读器的情况下使用json服务?
如果有人知道,请让我知道.

hi to all
how to consume a json service without using stream reader?
if anybody knows, please let me know.

推荐答案

例如,通过HttpWebRequest发出请求时,您始终会得到HttpWebResponse,这是唯一的获取途径服务器回答的是从响应流中读取它.如果您不愿意处理从流中读取的内容,则需要有人编写库包装程序,以使您免受如此可怕的低级编程的影响.从流中读取仍然会发生,但是至少您不必在代码中看到它.

最好的问候,

—MRB
When making a request via HttpWebRequest for instance you always get a HttpWebResponse and the only way to get at what the server answered back is to read it from the response stream. If you can''t be bothered handling reading from a stream you''ll need somebody to write a library wrapper to shield you from such ghastly low level programming. Reading from a stream will still take place, but at least you won''t have to see it in your code.

Best regards,

—MRB


这篇关于消费json服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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