iOS AFN-将token添加到请求头header中请求

AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];    

    //调出请求头

    manager.requestSerializer = [AFJSONRequestSerializer serializer];

    //将token封装入请求头

    [manager.requestSerializer setValue:TOKEN forHTTPHeaderField:@"Authentication"];

    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/plain",@"text/html",@"application/json", nil];

你可能感兴趣的:(iOS AFN-将token添加到请求头header中请求)