首先,我POST /v1/requests
使用我的有效访问令牌创建了一个 Uber 沙箱,Uber 返回202 OK
给我,这意味着请求成功。
然后我发出请求,试图用 来操纵请求的状态PUT /v1/sandbox/requests/{request_id}
,但我只能得到405
代码。
所有的状态我都试过了,结果都是405
,请帮忙看看有没有可能的原因。谢谢。
我通过PUT /v1/sandbox/requests/{request_id}
以下方式提出更改状态 ( ) 的请求:
NSString *url = [NSString stringWithFormat:@"%@/requests/%@", sandBoxURL, requestId];
NSDictionary *params = @{@"status": @"processing"};
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]];
[request addValue:@"application/json; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[request addValue:[NSString stringWithFormat:@"Bearer %@", _accessToken] forHTTPHeaderField:@"Authorization"];
NSError *error = nil;
request.HTTPMethod = @"PUT";
request.HTTPBody = [NSJSONSerialization dataWithJSONObject:params options:0 error:&error];