@capgo/capgo-skills
Version:
55 agent skills for Capacitor mobile development
45 lines (31 loc) • 871 B
Markdown
Native HTTP support by patching `fetch` and `XMLHttpRequest` to use native libraries.
**Platforms:** Android, iOS, Web
Bundled with `@capacitor/core`. No separate install needed.
Enable in `capacitor.config.ts` (or `.json`):
```json
{
"plugins": {
"CapacitorHttp": {
"enabled": true
}
}
}
```
```typescript
import { CapacitorHttp } from '@capacitor/core';
const response = await CapacitorHttp.get({
url: 'https://api.example.com/data',
headers: { Authorization: 'Bearer token' },
});
const postResponse = await CapacitorHttp.post({
url: 'https://api.example.com/data',
data: { key: 'value' },
});
```
- Methods: `request()`, `get()`, `post()`, `put()`, `patch()`, `delete()`.
- Data can only be string or JSON on Android/iOS. For large files use `@capacitor/file-transfer`.