我正在使用 C# 调用 Square Connect 支付 API。文档说如果结果被分页,我应该得到一个“链接”的标题键。但是,我在响应中只得到 100 个结果,并且没有“链接”的标题键。这是我的代码:
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", String.Format("Bearer {0}", "<Token>"));
client.DefaultRequestHeaders.Add("Accept", "application/json");
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
DateTime startDate = DateTime.UtcNow.Date;
var paymentUrl = string.Format("https://connect.squareup.com/v1/me/payments?begin_time={0:yyyy-MM-dd}T00:00:00Z&end_time={1:yyyy-MM-dd}T00:00:00Z", startDate.AddDays(-25).Date, startDate.Date);
var responseMessage = await client.GetAsync(paymentUrl);