0
我有这个代码超时,因为有很多来自服务器的数据。有谁知道是否有办法阻止超时?HttpWebRequest超时
static List<PhraseSource> GetPhrases()
{
var request = HttpWebRequest.Create("http://aaa.cloudapp.net/api/Phrase/GetJDTO");
request.ContentType = "application/json";
request.Method = "POST";
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
string json = Newtonsoft.Json.JsonConvert.SerializeObject(new
{
form = "2", // just get words
type = "0"
});
streamWriter.Write(json);
}
这是我的C#服务器代码。不知道,但也许也有一个问题存在与但现在它似乎是在客户端上:
[HttpPost]
[AllowAnonymous]
[Route("GetJDTO")]
public async Task<IHttpActionResult> GetJDTO([FromBody] GetJDTOOptions options)
{
IQueryable<Phrase> query = null;
query = db.Phrases.AsQueryable();
检查API有一个分页选项,并获得小批量的项目..? – thisextendsthat
你不会显示你曾经调用'GetResponse()' – Crowcoder