我尝试从内容中读取多维数组作为请求:
[
{
"content" : {
"parcel" : {
"ServiceParcelEventPostalCode" : "1005",
"ConsigneePostalCode" : "1220 (292)",
"ParcelTypeDescription" : "Paket",
"ReferenceIdentcode" : "1017348010239480212208",
"CustomerShipmentNr" : "N\/A",
"Identcode" : "1017348010239480212208",
"ReferenceNumber" : "D1Lmp8TPN_1",
.......... ETC
我是,试图在ServiceParcelEventPostalCode
没有访问权限的情况下获得:
NSString *urlString = @"http://www.post.at/sendungsverfolgung4.php";
NSURL *url = [NSURL URLWithString:urlString];
// URL-Request-Objekt erstellen
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:url];
[request setHTTPMethod:@"GET"];
NSMutableData *body = [NSMutableData data];
NSString *postWerte = [NSString stringWithFormat:@"id=%@", self.textfeld.text];
[body appendData:[postWerte dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:body];
// Abfrage ans Web senden und Rückgabe in Variable speichern
NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding];
const char *convert = [returnString UTF8String];
NSString *responseString = [NSString stringWithUTF8String:convert];
NSMutableArray *meinErgebnis = [responseString JSONValue];
NSString *wert1 = [NSString stringWithFormat:@"%@",[[[meinErgebnis objectAtIndex:2] objectAtIndex:0] objectForKey:@"ServiceParcelEventPostalCode"]];