随月云短信 · 技术支持

短信接口示例

这篇文章主要为大家分享ObjectC短信接口代码,ObjectC短信发送、ObjectC批量发送、ObjectC短信验证码发送,感兴趣的小伙伴们可以参考一下。


NSString *httpUrl = @"https://www.suisms.net/sms.aspx";
NSString *httpArg = @"action=send&userid=userid&account=account&password=password&mobile=mobile&content=content";
[self request: httpUrl withHttpArg: httpArg];

-(void)request: (NSString*)httpUrl withHttpArg: (NSString*)HttpArg  {
    NSString *urlStr = [[NSString alloc]initWithFormat: @"%@?%@", httpUrl, HttpArg];
    NSURL *url = [NSURL URLWithString: urlStr];
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL: url cachePolicy: NSURLRequestUseProtocolCachePolicy timeoutInterval: 10];
    [request setHTTPMethod: @"GET"];
    [NSURLConnection sendAsynchronousRequest: request
        queue: [NSOperationQueue mainQueue]
        completionHandler: ^(NSURLResponse *response, NSData *data, NSError *error){
            if (error) {
                NSLog(@"Httperror: %@%ld", error.localizedDescription, error.code);
            } else {
                NSInteger responseCode = [(NSHTTPURLResponse *)response statusCode];
                NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                NSLog(@"HttpResponseCode:%ld", responseCode);
                NSLog(@"HttpResponseBody %@",responseString);
            }
        }];
}


现在注册,即享新手专属礼包!

立即免费注册

正规资质

工信部核准资质,移动、电信、联通金牌合作伙伴

价格透明

明码标价不欺瞒客户,坚决抵制扣量、漏发等行为

信息保密

所有客户信息严格保密,保护客户信息免遭外泄

售后无忧

专业团队提供免费技术支持,7X24小时售后服务

QQ咨询

QQ号码

143761

扫一扫

扫码关注 · 接收账户异常报警 · 消费账单随时查 · 活动及最新平台信息

返回顶部