我有一个url作为https://www.xyz.in/ws/bt与请求参数作为标记,blockrequest和格式。 样品JSON“blockrequest”字符串如何发送json对象作为请求参数在URL中使用HttpsURLConnection android
{"source\":\"1492\",\"destination\":\"1406\",\"availableTripId\":\"100008417320611112\",\"boardingPointId\":\"1129224\",\"inventoryItems\":[{\"seatName\":\"21\",\"ladiesSeat\":\"false\",\"passenger\":{\"name\":\"passenger_name_1\",\"title\":\"MR\",\"gender\":\"MALE\",\"age\":\"23\",\"primary\":true,\"idType\":\"PANCARD\",\"email\":\"[email protected]_name.com\",\"idNumber\":\"BEPS1111B\",\"address\":\"passenger_address\",\"mobile\":\"xxxxxxxxxx\"},\"fare\":\"320.00\"},{\"seatName\":\"22\",\"ladiesSeat\":\"true\",\"passenger\":{\"name\":\"passenger_name_1\",\"title\":\"MS\",\"gender\":\"FEMALE\",\"age\":\"23\",\"primary\":false,\"idType\":\"\",\"email\":\"\",\"idNumber\":\"\",\"address\":\"\",\"mobile\":\"\"},\"fare\":\"320.00\"}]}
我如何使用HttpsURLConnection的在URL发送这个数据作为请求参数。
带有“请求参数”你的意思是HTTP GET请求? – Robert
不,通过HTTPS POST请求。 – QEMU
http://stackoverflow.com/a/2938787/793943检查这个答案 – Sush