Google Custom Search: 403 error in iOS

前端 未结 1 1976
你的背包
你的背包 2020-12-19 09:33

Google Custom Search is returning this 403 error from my iPhone 7.1 app. This is the response when run in the simulator:

{
 \"error\": {
  \"errors\": [
            


        
1条回答
  •  隐瞒了意图╮
    2020-12-19 09:38

    It was missing the header field X-Ios-Bundle-Identifier.

    NSString *bundleID = @"com.yourCompany.yourApp";
    //...define request as above
    [request setHTTPMethod:@"GET"];
    [request setValue:bundleID forHTTPHeaderField:@"X-Ios-Bundle-Identifier"];
    

    0 讨论(0)
提交回复
热议问题