Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| url | String | Yes | Request URL (HTTPS required in production) |
| method | String | No | HTTP method: GET, POST, PUT, DELETE (default: GET) |
| data | Object | No | Request data |
| headers | Object | No | Request headers |
| timeout | Number | No | Timeout in ms (default: 30000) |
| dataType | String | No | Response type: json, text, base64 |
| success | Function | No | Callback on success |
| fail | Function | No | Callback on failure |
| complete | Function | No | Callback that always executes |
Success Callback
| Property | Type | Description |
|---|---|---|
| data | Object/String | Response data |
| status | Number | HTTP status code |
| headers | Object | Response headers |
Code Example
Related APIs
my.uploadFile
Upload file
my.downloadFile
Download file