This example uses the Zend Framework (framework.zend.com) to get data from ap_list.xml:
$baseUrl = "https://myampserver.domain.com";$username = "myuser";$password = "mypassword";$client = new Zend_Http_Client();$client->setCookieJar();$client->setUri($baseUrl."/LOGIN");$client->setParameterPost('credential_0',$username);$client->setParameterPost('credential_1',$password);// we are simply authenticating$client->setParameterPost('destination',$baseUrl);$response = $client->request('POST');// Then we can go on and use other uri's for example getting an AP with id of '123' in xml// Just comment out the $arguments line if you want to grab all of them$arguments = array('id' => 123);$client->setUri($baseUrl."/ap_list.xml");if(isset($arguments)){ foreach($arguments as $arg => $value) $client->setParameterGet($arg, $value);}$response = $client->request('GET');$xml = new SimpleXMLElement($response->getBody());
© Copyright 2024 Hewlett Packard Enterprise Development LPAll Rights Reserved.