ios - Sending byte data to web service in cocos2d iphone -
i want send byte data using existed web service . don't want explore on web service more want following byte data existed web service. example , following byte data .
byte *bytedata = (byte*)malloc(len); memcpy(bytedata, (byte*)mydata, len); how can !? want use existed web service only,your appreciated lot .
edited
i have nsdata in json format . below code
const unsigned char *bytes = [mydata bytes]; // no need copy data nsuinteger length = [mydata length]; nsmutablearray *bytearray = [nsmutablearray array]; (nsuinteger = 0; < length; i++) { [bytearray addobject:[nsnumber numberwithunsignedchar:bytes[i]]]; } nsdictionary *dictjson = [nsdictionary dictionarywithobjectsandkeys: bytearray, @"vedio", nil]; nsdata *jsondata = [nsjsonserialization datawithjsonobject:dictjson options:0 error:null];
i send nsdata or bytedata :
nsmutabledictionary *dictparam = [nsmutabledictionary dictionary]; [dictparam setvalue:mydata forkey:@"pattern"]; nsstring *web_str_pattern = @"my webservice link"; jsonparser *parser = [[jsonparser alloc]initwith_withurl:web_str_pattern withparam:dictparam withdata:nil withtype:kposturl withselector:@selector(getdata:) withobject:self]; here , using jsonparser web service.
Comments
Post a Comment