English 中文(简体)
WP7——ResSharp - Cannot获得XML格式的回归数据
原标题:WP7 - RestSharp - Cannot get returned data in XML format

我在我的Windows Telephone 7.1项目中使用ResSharp。

我的问题是,我无法以XML格式获得回复数据,我总是在JSON作出答复,而我的服务器支持JSON和XML。

Example: URL: http://timtim.vn:8080/fktw/services/timhot/photo/15732

如你所知,服务器可以退回XML。 但是,在我的项目中,SatSharp的反应是JSON格式。 我已定下请购单<代码>request.RequestFormat = 数据格式。 页: 1

与JsonDeserializer一起,我仍然完全不顾反应,但我想知道这一问题的原因。

谢谢!

最佳回答
问题回答

在客户申报后,我迅速走到一线:

client.ClearHandlers();
client.AddHandler("application/xml", new XmlDeserializer());
client.AddHandler("text/xml", new XmlDeserializer());




相关问题
How to use RestSharp with OAuth?

I am confused which factory OAuth1Authenticator factory method should I use. I think I should get a consumer secret token (can I get it with RestSharp?), then use OAuth1Authenticator.ForRequestToken, ...

Refreshing in RestSharp for Windows Phone

I implemented RestSharp succesfully in my WP7 application, but one issue remains: When I load resources from the server (for example a GET request on http://localhost:8080/cars), the first time the ...

Deserializing XML CDATA into string variable with RestSharp

I m trying to take an RSS feed and deserialize it into a list of rssEntry objects. var Client = new RestClient("url here"); Request = new RestRequest { RequestFormat DataFormat.Xml }; var response = ...

error while adding restsharp refernce

I have a problem adding the reference of REstsharp.dll. It says: "Reference cannot be added to d:Vinay sreeRestSharp-101.2RestSharp.dll because it was not built using the Windows Phone runtime. ...

How to add text to request body in RestSharp

I m trying to use RestSharp to consume a web service. So far everything s gone very well (cheers to John Sheehan and all contributors!) but I ve run into a snag. Say I want to insert XML into the body ...

REST Windows Phone Photo upload

I m trying to upload a photo to a REST api in a Windows Phone 7 application using RestSharp for my Gets/Posts. The post parameters are as follows: photo: The photo, encoded as multipart/form-...

RestSharp v. WebClient?

I m building a Windows Phone 7 Silverlight app. Is there any reason to use RestSharp instead of WebClient? I ve looked around on the RestSharp site, but it s not immediately obvious what the benefits ...

Using restsharp in c# to consume last.fm services

I m trying to connect to the last.fm rest services using restsharp. I can deserialize the simple data found at the example: http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=Cher&...

热门标签