Skip to content

Commit b456119

Browse files
authored
Merge pull request #7 from Deltik/master
Fix mangling of POST data
2 parents 02dea0f + 90dacef commit b456119

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
##cPanel UAPI and API2 PHP class
1+
## cPanel UAPI and API2 PHP class
22

33
PHP class to provide an easy to use interface with cPanel’s UAPI and API2.
44
Uses php magic functions to provide a simple and powerful interface.
@@ -7,16 +7,16 @@ v2.0 is not backwards compatible, and will likley under go a few more changes, s
77
The class has been renamed to cpanelAPI.
88
Some more testing is required.
99

10-
##Usage
10+
## Usage
1111

1212
See the example files, but typical useage takes the form of:
1313

14-
###Instantiate the class
14+
### Instantiate the class
1515
```
1616
$capi = new cpanelAPI('user', 'password', 'cpanel.example.com');
1717
```
1818
The API we want to use and the Module (also called Scope) are now protected and are set by `__get()`.
19-
The request layout looks like this: $capi->api->Module->request(args[])
19+
The request layout looks like this: `$capi->api->Module->request(args[])`
2020

2121
For example. We want to use the UAPI to call the Mysql get_restrictions function.
2222
```
@@ -32,12 +32,12 @@ $response = $capi->create_database(['name' => $capi->user.'_MyDatabase']);
3232
print_r($response);
3333
```
3434

35-
we can also change the scope without respecifying the api, note that the Module call is case sensative.
35+
we can also change the scope without respecifying the api, note that the Module call is case-sensitive.
3636
```
3737
$response = $capi->SSL->list_certs();
3838
```
3939

40-
###API2
40+
### API2
4141

4242
API2 is used in exactly the same way as the UAPI
4343
```

cpaneluapi.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,9 @@ protected function APIcall($name, $arguments)
179179
$this->requestUrl .= http_build_query($arguments);
180180
}
181181
if($this->httpMethod == 'POST'){
182-
$this->postData = http_build_query($arguments);
182+
$this->postData = $arguments;
183183
}
184184

185-
print $this->postData;
186185
return $this->curl_request($this->requestUrl);
187186
}
188187

0 commit comments

Comments
 (0)