title: How to send param value to Server and get data using AsyncTask (by POST Request)?
body: <p>this code is ok for get data from server but if my API is POST Method how to pass params to server by POSt Request and fetch data. code is here, please let me know</p>
  
  <pre><code>    public  class GetTripTeportData extends AsyncTask&lt;String, Integer,String&gt; {
      @Override
      protected void onPreExecute() {...}
  
      @Override
      protected String doInBackground(String... params) {
          String responseBodyText = null;
          OkHttpClient client = new OkHttpClient();
          try {
              Request request = new Request.Builder().url(excelApi).build();
              Response response = null;
              response = client.newCall(request).execute();//.....
  
                  responseBodyText = response.body().string();
                  JSONObject resultData = new JSONObject(responseBodyText);
                  JSONArray itemArray = resultData.getJSONArray("data");
                  for (int i=0; i&lt;itemArray.length();i++){
                      JSONObject jobject = itemArray.getJSONObject(i);
                      String iduser = jobject.getString("id");
                      String vehicleno = jobject.getString("vehicleno");
                      String startdate = jobject.getString("startdate");
                      allList.add(new ExcelReportAdminResponse(iduser,vehicleno,startdate));
                  }
              }
          } catch (IOException e) {
              e.printStackTrace();
          } catch (JSONException e) {
              e.printStackTrace();
          }
          runOnUiThread(new Runnable() {
              @Override
              public void run() {
              }
          });
          return responseBodyText;
      }
  
      @Override
      protected void onPostExecute(String s) {......}
  }
  </code></pre>