I am new to objectiveC, I have a problem in retrieving JSON type from a url, the url represent a web service which had built to return both JSON and XML, when I tried to consume the web service from the url the result was XML, what I need is to determine the type of returning data to be JSON in the request. by the way I am sure that the web service return both XML and JSON.
and here is my code where I get XML:
NSURL *url = [[NSURL alloc] initWithString:@"http://192.168.1.1:8080/test2/eattel/restaurants"];
NSString *result=[[NSString alloc] initWithContentsOfURL:url];
NSLog(@"%@",result);
the result is :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<restaurantImpls>
<Resstaurant Name="Abo Alshamat" PhoneNumber="0991992994" MobileNumber="0991992993" LastName="Shame" ID="1" FirstName="Samer"/>
<Resstaurant Name="AL-Kamal" PhoneNumber="0992993995" MobileNumber="0992993994" LastName="Ali" ID="2" FirstName="Ahmad"/>
<Resstaurant Name="Abo-MAhmoud" MobileNumber="0993377800" ID="12"/>
<Resstaurant Name="Four Season" PhoneNumber="0993994996" MobileNumber="0993994995" LastName="Ammar" ID="3" FirstName="William"/>
<Resstaurant Name="uuuuu" MobileNumber="0999555777" LastName="William" ID="20" FirstName="Ammar"/>
<Resstaurant Name="NewOneFromI2" MobileNumber="0999888777" ID="18"/>
<Resstaurant Name="JOURY" PhoneNumber="0999999998" MobileNumber="0999998997" ID="4"/>
<Resstaurant Name="TestTestRestaurant,Ammar,Hamed" MobileNumber="202020" ID="19"/>
</restaurantImpls>
thank you for your time.