Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Are you sure you're actually posting the data? </p> <p>You could try sending the POST request more like below methods. Then you should be able to simply get your value in the PHP with $_POST</p> <pre><code>public void execute(final RequestMethod method) throws IllegalArgumentException, UnsupportedEncodingException { switch (method) { case GET: // add parameters String combinedParams = ""; if (!params.isEmpty()) { combinedParams += "?"; for (NameValuePair p : params) { String paramString = p.getName() + "=" + URLEncoder.encode(p.getValue(), "UTF-8"); if (combinedParams.length() &gt; 1) { combinedParams += "&amp;" + paramString; } else { combinedParams += paramString; } } } HttpGet getRequest = new HttpGet(remoteUrl + combinedParams); // add headers for (NameValuePair h : headers) { getRequest.addHeader(h.getName(), h.getValue()); } executeRequest(getRequest, remoteUrl); break; case POST: HttpPost postRequest = new HttpPost(remoteUrl); // add headers for (NameValuePair h : headers) { postRequest.addHeader(h.getName(), h.getValue()); } if (!params.isEmpty()) { postRequest.setEntity(new UrlEncodedFormEntity( (List&lt;? extends NameValuePair&gt;) params, HTTP.UTF_8)); } executeRequest(postRequest, remoteUrl); break; default: break; } } </code></pre> <p>And</p> <pre><code>private void executeRequest(final HttpUriRequest request, final String url) { HttpClient client = new DefaultHttpClient(); HttpResponse httpResponse; try { httpResponse = client.execute(request); responseCode = httpResponse.getStatusLine().getStatusCode(); errorMessage = httpResponse.getStatusLine().getReasonPhrase(); HttpEntity entity = httpResponse.getEntity(); if (entity != null) { responseStream = entity.getContent(); if (!needStreamInsteadOfString) { response = convertStreamToString(responseStream); // Closing the input stream will trigger connection release responseStream.close(); } } } catch (ClientProtocolException e) { client.getConnectionManager().shutdown(); e.printStackTrace(); } catch (IOException e) { client.getConnectionManager().shutdown(); e.printStackTrace(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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