0

i am new in objective c. i want to post the payload json data to the server. i also added the sample json payload request format.

   http://webapi.i2space.co.in/Flights/GetTaxDetails
   payload json:
{
    "DeviceModel": null,
    "DeviceOS": null,
    "DeviceOSVersion": null,
    "DeviceToken": null,
    "OnwardFlightSegments": [{
        "FlightNumber": "1038",
        "OperatingAirlineCode": "SG",
        "OperatingAirlineFlightNumber": "1038",
        "RPH": "",
        "OcTax": "0",
        "BookingClass": {
            "Availability": "",
            "ResBookDesigCode": "",
            "IntBIC": ""
        },
        "BookingClassFare": {
            "AdultFare": "",
            "Bookingclass": "",
            },
        "IntNumStops": null,
        "IntOperatingAirlineName": null,
        "Cabin": null,
        "itineraryNumber": null,
        "BaggageAllowed": {
            "CheckInBaggage": "7 Kg",
            "HandBaggage": "0 Kg"
        }
    }],
    "ReturnFlightSegments": null,
    "FareDetails": {
        "ChargeableFares": {
            "ActualBaseFare": 1450,
            "Tax": 862,
            "STax": 0,
            },
        "NonchargeableFares": {
            "TCharge": 0,
            "TMarkup": 0,
            "TSdiscount": 0
        },
        "FareBreakUp": {
            "FareAry": [{
                "IntPassengerType": "1",
                "IntBaseFare": 1450,
                "IntTax": 862,
                "IntTaxDataArray": null
            }]
        },
        "OCTax": 0,
        "TotalFare": 2312,
        "ResponseStatus": 0,
        "Status": 0,
        "Message": null
    },
    "BookingDate": "\/Date(-62135596800000)\/",
    "PromoCode": null,
    "PromoCodeAmount": 0,
    "PostMarkup": 0,
    "IsLCC": "true",
    "IsLCCRet": null,
    "BookedFrom": null,
    "Destination": "BLR",

}

In the above json payload i need to send the dynamic values like device model, device os and etc. can anyone suggest me that how can i post the values in the above payload request ?

Nirav Kotecha
  • 2,493
  • 1
  • 12
  • 26
user19
  • 131
  • 2
  • 12

1 Answers1

0

"appversion" : [NSString stringWithFormat:@"%@ (%@)", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"], [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"] ]

"systemversion" : [[UIDevice currentDevice] systemVersion]]

check this question for device type
How to get device make and model on iOS?