Saturday, 15 March 2014

Equivalent of PostMethod of Java in PHP -


I would like to ask if there is a PHP function to simulate the block of this code in Codeigniter.

  HTTP Client httpClient = New HTTP Client (); Post-post post-method = new post-method (request URL); NameValuePair [] datas = {New Name ValuePair ("studentnumber", studentnumber), New Name ValuePair ("studentdata", encrypted data)}; PostMethod.setRequestBody (datas); Int statusCode = httpClient.executeMethod (postMethod); Byte [] Reaction = postMethod.getResponseBody (); String feedbackBody = new string (response, "UTF-8");  

Curl does not appear to be working, whereas $ -> output-> set_output data passes properly, but fails to capture the requestUrl's response.

Thank you

I request the request from url using the block of code I could find what I found (thanks a lot for this)

arrays ('http' = & gt; array ('method' = & gt; "POST", 'header' = & gt; "Accept language: En \ r \ N "." Content-type: application / x-www-form-urlcode \ r \ n ", 'content' = & gt; http_build_query (array ('studentnumber' => gt; $ studentnumber, 'studentdata' = & gt ; $ Encrypted data,), '', '& amp;'))); $ Refno = file_get_contents ($ request url, false, $ reference);

No comments:

Post a Comment