использую Jsoup в написание приложения для Android не могу разобраться как передать Json при POST запросе на страницу
String payload2 = "{'fields':{'car':['id']},{'offset':1}";
Connection connect = connect(url1);
connect.header("User-Agent", "Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0");
connect.header("Accept-Language", "ru");
connect.ignoreContentType(true);
connect.requestBody(payload2);
//.header("Accept", "application/json")
//.header("Content-Type", "application/json")
res = connect.execute();
такой формат выдает ошибку:
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.example.andrew.gazadmin, PID: 13212
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:354)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
at java.util.concurrent.FutureTask.run(FutureTask.java:271)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)
Caused by: java.lang.IllegalArgumentException: Cannot set a request body for HTTP method GET
at org.jsoup.helper.Validate.isFalse(Validate.java:64)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:733)
at org.jsoup.helper.HttpConnection$Response.execute(HttpConnection.java:722)
at org.jsoup.helper.HttpConnection.execute(HttpConnection.java:306)
at com.example.andrew.gazadmin.GazAdmin$MyTask3.doInBackground(GazAdmin.java:133)
at com.example.andrew.gazadmin.GazAdmin$MyTask3.doInBackground(GazAdmin.java:51)
at android.os.AsyncTask$2.call(AsyncTask.java:333)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)