Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Probably you are not concatenating the psSurveyID properly. </p> <pre><code>String input ="{\"survey_id\": p_sSurveyID, \"fields\":[\"url\"]}"; -- not working </code></pre> <p>should be</p> <pre><code>String input ="{\"survey_id\":"+ p_sSurveyID+",\"fields\":[\"url\"]}"; -- should work System.out.println("p_sSurveyID --- " + p_sSurveyID); try { List&lt;NameValuePair&gt; parameters = new ArrayList&lt;NameValuePair&gt;(); parameters.add(new NameValuePair("api_key",p_sApiKey)); URL url = new URL(createUrl(BASE_URL+COLLECTOR_LIST_ENDPOINT,parameters)); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/json"); conn.setRequestProperty("Authorization", "bearer "+p_sAuthToken); String input ="{\"survey_id\":"+ p_sSurveyID+",\"fields\":[\"url\"]}"; OutputStream os = conn.getOutputStream(); os.write(input.getBytes()); os.flush(); if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) { throw new RuntimeException("Failed : HTTP error code : " +conn.getResponseCode()); } BufferedReader br = new BufferedReString input ="{\"survey_id\":"+ p_sSurveyID+",\"fields\":[\"url\"]}"; OutputStream os = conn.getOutputStream(); os.write(input.getBytes()); os.flush(); if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) { throw new RuntimeException("Failed : HTTP error code : " + conn.getResponseCode()); } BufferedReader br = new BufferedReader(new InputStreamReader( (conn.getInputStream()))); conn.disconnect(); ader(new InputStreamReader( (conn.getInputStream()))); conn.disconnect(); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload