I am new to PHP and wanted to write a snippet of code which would call a Webservice. I have the java equivalent code for it that works correctly.
HttpClient client=new HttpClient();
GetMethod method=new GetMethod(URL);
method.addRequestHeader("test1","test1");
String statusCode=client.executeMethod();
if (statusCode != HttpStatus.SC_OK) {
System.err.println("Method failed: " + method.getStatusLine());
}
// Read the response body.
byte[] responseBody = method.getResponseBody();
// Deal with the response.
// Use caution: ensure correct character encoding and is not binary data
System.out.println(new String(responseBody));