HttpWebRequest request = WebRequest.Create(requestUrl) as HttpWebRequest;
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
if (response.StatusCode != HttpStatusCode.OK)
throw new Exception(String.Format(
"Server errOr (HTTP {0}: {1}).",
response.StatusCode,
response.StatusDescription));
DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(Clari5AppWeb.Pages.Response));
object objResponse = jsonSerializer.ReadObject(response.GetResponseStream());
Response jsonResponse = objResponse as Response;
return jsonResponse;
请解决;仅对某些搜索值,它会给出错误。