我的代码如下
FileStream fs = new FileStream(fileName, FileMode.Open);
var request = new OAuth2Request("POST", new Uri("https://www.strava.com/api/v3/uploads"), null, StravaAccount);
request.AddMultipartData("file", input, "application/gpx+xml", Uri.EscapeDataString(fileName));
Response response = await request.GetResponseAsync();
我得到的答复是:
{"message":"Bad Request","errors":[{"resource":"Upload","field":"data","code":"empty"}]}
https://developers.strava.com/docs/reference/#api-Uploads-createUpload (因此,它被称为文件而不是数据-这只是一个错误的返回消息)。 我在通话中做错什么,为什么没有发送数据?