title: I tried from POSTMAN API working fine but not from my Java code?
body: <p>Please I have gone through all the question from stackoverflow, but those are not applicable to my problem.</p>
  
  <p><a href="https://i.stack.imgur.com/wrrOq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wrrOq.png" alt="enter image description here"></a>
  Please have look in image request working fine from <code>POSTMAN</code>.</p>
  
  <p>But When I tried from <code>android</code> code it is not working.
  My Sample Android code is here.</p>
  
  <pre><code>@Override
          protected String doInBackground(Void... params) {
              HttpURLConnection urlConnection = null;
              BufferedReader reader = null;
  
              // Will contain the raw JSON response as a string.
              String forecastJsonStr = null;
  
              try {
                  URL url = new URL("sample url");
  
                  String postData = "key1=valu1&amp;key2=valu2";
  
                  HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                  conn.setReadTimeout(55000 /* milliseconds */);
                  conn.setConnectTimeout(55000 /* milliseconds */);
                  conn.setRequestMethod("POST");
                  conn.setDoInput(true);
                  conn.setDoOutput(true);
                  OutputStream os = conn.getOutputStream();
                  BufferedWriter writer = new BufferedWriter(
                          new OutputStreamWriter(os));
                  writer.write(postData);
  
                  writer.flush();
                  writer.close();
                  os.close();
  
                  int responseCode=conn.getResponseCode();
  
                  if (responseCode == HttpsURLConnection.HTTP_OK) {
  
                      BufferedReader in=new BufferedReader(
                              new InputStreamReader(
                                      conn.getInputStream()));
                      StringBuffer sb = new StringBuffer("");
                      String line="";
  
                      while((line = in.readLine()) != null) {
                          Log.e("response ",line);
                          sb.append(line);
                          break;
                      }
  
                      in.close();
                      return sb.toString();
  
                  }
                  else {
                      return new String("false : "+responseCode);
                  }
              } catch (Exception e) {
                  Log.e("PlaceholderFragment", "Error ", e);
                  // If the code didn't successfully get the weather data, there's no point in attemping
                  // to parse it.
                  return null;
              } finally {
                  if (urlConnection != null) {
                      urlConnection.disconnect();
                  }
                  if (reader != null) {
                      try {
                          reader.close();
                      } catch (final IOException e) {
  
                      }
                  }
              }
          }
  </code></pre>
  
  <p>Above  java code return 405 error code. I also tried from <code>OkHttp</code> also.
  Please help.</p>