dev.altai / POSTMAN_FIX.md
prince1604
Support both JSON body and query params for scanstart endpoint
b8a29b5
|
Raw
History Blame Contribute Delete
1.76 kB
## ❌ Current Issue in Your Postman Request
**What you're doing:**
```
POST https://ubuntu593-alt-scraper-api.hf.space/api/scanstart?domain=https://wpengine.com/&limit=26
```
With parameters in the **Params** tab.
**Why it fails:** The POST endpoint expects JSON in the **Body**, not query parameters.
---
## ✅ FIX: Correct Postman Configuration
### Step-by-Step:
1. **Set the URL** (Remove all query parameters):
```
https://ubuntu593-alt-scraper-api.hf.space/api/scanstart
```
2. **Method**: Keep it as `POST`
3. **Go to the "Body" tab** (NOT "Params")
- Select `raw`
- Change dropdown from "Text" to `JSON`
4. **Paste this into the Body**:
```json
{
"domain": "https://wpengine.com/",
"limit": 26
}
```
5. **Headers** (should auto-populate, but verify):
- `Content-Type: application/json`
6. **Click "Send"**
---
## ✅ Expected Response:
```json
{
"job_id": "abc-123-def-456"
}
```
Then use that `job_id` to check progress:
```
GET https://ubuntu593-alt-scraper-api.hf.space/api/progress?job_id=abc-123-def-456
```
---
## 🖼️ Visual Guide for Postman
### Screenshot 1: URL Setup
- URL: `https://ubuntu593-alt-scraper-api.hf.space/api/scanstart`
- Method: `POST`
- **Params tab should be EMPTY**
### Screenshot 2: Body Setup
- Go to **Body** tab
- Select **raw**
- Select **JSON** from dropdown
- Paste:
```json
{
"domain": "https://wpengine.com/",
"limit": 26
}
```
### Screenshot 3: Headers
- Should show `Content-Type: application/json` automatically
---
## 🚀 Alternative: Use Query Parameters (I'll add support)
If you prefer using query parameters like:
```
POST /api/scanstart?domain=...&limit=...
```
Let me know and I'll modify the API to support both methods!