title: java.io.IOException: Server returned HTTP response code: 500 for URL:
body: <p>I am trying to call REST API from Informatica Java transformation and the java code is as below, the Id and Email are two fields I am getting from previous transformation (source file). When I test with actual values of access token, Id and Email , the request works but when i give  the field names I get 500 error.</p>
  <pre class="lang-java prettyprint-override"><code>try {
      URL url = new URL(&quot;https://ditabc.com&quot;);
      HttpsURLConnection conn = (HttpsURLConnection) url.openConnection();
      conn.setDoOutput(true);
      conn.setRequestProperty(&quot;Authorization&quot;, access_token);
      conn.setRequestMethod(&quot;POST&quot;);
      conn.setRequestProperty(&quot;Accept&quot;, &quot;application/json&quot;);
      conn.setRequestProperty(&quot;Content-Type&quot;, &quot;application/json&quot;);
      String requestBody = &quot;[{\&quot;Id\&quot;:\&quot;Id\&quot;, \&quot;EmailId\&quot;:\&quot;EmailId\&quot;}]&quot;;
      try (OutputStream os = conn.getOutputStream()) {
          byte[] input = requestBody.getBytes(&quot;utf-8&quot;);
          os.write(input, 0, input.length);
      } catch (Exception e) {
          System.out.println(e);
      }
  
      //    String line;
  
      StringBuffer response = new StringBuffer();
      BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
  
      if (conn.getResponseCode() == HttpsURLConnection.HTTP_OK) {
          while ((line = reader.readLine()) != null) {
              response.append(line);
          }
          final_response = response.toString();
      }
      reader.close();
      conn.disconnect();
  } catch (Exception e) {
      logInfo(&quot;Error&quot;);
      final_response = e.toString();
  }
  </code></pre>
  <p>I am trying to call the end point URL here. Can you help if the error response is due to the server not reachable or any issue in the code?</p>