私の api/xml は、現在から 10 日まで終了するオークションを返すことで正常に動作していますが、10 日後に終了するリストでは動作しません:
結果をダウンロードする方法は次のとおりです。
public string DownLoad(string url)
{
// used to build entire input
StringBuilder sb = new StringBuilder();
// used on each read operation
byte[] buf = new byte[32768];
try
{
// prepare the web page we will be asking for
HttpWebRequest request = (HttpWebRequest)
WebRequest.Create(url);
// execute the request
HttpWebResponse response = (HttpWebResponse)
request.GetResponse();
// we will read data via the response stream
Stream resStream = response.GetResponseStream();
string tempString = null;
int count = 0;
do
{
// fill the buffer with data
count = resStream.Read(buf, 0, buf.Length);
// make sure we read some data
if (count != 0)
{
// translate from bytes to ASCII text
tempString = Encoding.ASCII.GetString(buf, 0, count);
// continue building the string
sb.Append(tempString);
}
}
while (count > 0); // any more data to read?
}
catch (Exception)
{
timer1.Enabled = false;
progressBar1.Visible = false;
msg.ForeColor = Color.Red;
msg.Text = "Please try after some time !!!";
msg.Visible = true;
}
// print out page source
// MessageBox.Show(sb.ToString());
return sb.ToString();
}