Note that there are some explanatory texts on larger screens.

plurals
  1. POJSON Serializer C#
    primarykey
    data
    text
    <p>I am developing online aircraft sales system.</p> <p>But I have a problem..</p> <p>A URL address have: </p> <pre><code>string urlFlightSearch = "https://api.iati.com/rest/flightSearch/" + ado.iatiKod + ""; </code></pre> <p>A have class "iati.cs" in codes</p> <pre><code>public class iati { public class flightSearch { public string fromAirport { get; set; } public bool allinFromCity { get; set; } public string toAirport { get; set; } public string fromDate { get; set; } public string returnDate { get; set; } public string adult { get; set; } public string currency { get; set; } } public class Leg { public string flightNo { get; set; } public string aircraft { get; set; } public string operatorCode { get; set; } public string operatorName { get; set; } public string departureAirport { get; set; } public string departureTime { get; set; } public string departureAirportName { get; set; } public string departureCityName { get; set; } public string arrivalAirport { get; set; } public string arrivalTime { get; set; } public string arrivalAirportName { get; set; } public string arrivalCityName { get; set; } } public class Detail { public double price { get; set; } public double serviceFee { get; set; } public double tax { get; set; } public int suplement { get; set; } } public class Fare { public double totalSingleAdultFare { get; set; } public string currency { get; set; } public string type { get; set; } public List&lt;string&gt; segmentNames { get; set; } public int freeSeatCount { get; set; } public Detail detail { get; set; } } public class Flight { public string id { get; set; } public string providerKey { get; set; } public string pricingType { get; set; } public int packageId { get; set; } public List&lt;Leg&gt; legs { get; set; } public List&lt;Fare&gt; fares { get; set; } public int segmentCount { get; set; } public int baggage { get; set; } public int flightTimeHour { get; set; } public int flightTimeMinute { get; set; } public int layoverTime { get; set; } public bool hasCip { get; set; } public bool canBook { get; set; } public bool canRezerve { get; set; } public bool dayCross { get; set; } public bool returnFlight { get; set; } } public class Result { public string searchId { get; set; } public List&lt;Flight&gt; flights { get; set; } } public class RootObject { public Result result { get; set; } } } </code></pre> <p>And posting...</p> <pre><code>WebClient wc = new WebClient(); var serializer = new JavaScriptSerializer(); iati.flightSearch search = new iati.flightSearch() { fromAirport = "IST", allinFromCity = true, toAirport = "AYT", fromDate = "2013-12-23", returnDate = "2013-12-30", adult = "1", currency = "EUR" }; var serializedResult = serializer.Serialize(search); wc.Headers[HttpRequestHeader.ContentType] = "application/json"; string result = wc.UploadString(urlFlightSearch, serializedResult); iati.Flight flight = serializer.Deserialize&lt;iati.Flight&gt;(result); </code></pre> <p>But the result returned is always coming up empty.</p> <p><img src="https://i.stack.imgur.com/oX9TK.png" alt="See this image here"></p> <p>Regards.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload