API:https://api.weixin.qq.com/wxa/getwxacodeunlimit
请求参数URL
请求BODY
{
"is_hyaline" : 1,
"scene" : "inviteCode=123456",
"env_version" : "trial",
"width" : 280
}
响应体:{
"errcode": 47001,
"errmsg": "data format error rid: 62a86863-159cc06e-424869ef"
}
我是用objective-c 语言。通过这个接口 生成小程序二维码图
请求体查了没有错误 。
这个请求体要用是什么格式的?
我的请求的:
- (void)reqQrCodeParamters:(NSDictionary*) paramters {
NSURL *url = [NSURL URLWithString:urlString];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url];
[request setHTTPMethod:@"POST"];
if (paramters) {
[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type”];
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:paramters
options:NSJSONWritingPrettyPrinted
error:&error];
NSString * query = [[NSString alloc] initWithData:jsonData
encoding:NSUTF8StringEncoding];
request.HTTPBody = [query dataUsingEncoding:NSUTF8StringEncoding];
}
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse * _Nullable response, NSData * _Nullable data, NSError * _Nullable connectionError) {
}];
}
is_hyaline 类型不对 文档是boolean类型 不是number