Metadata-Version: 2.4
Name: robotframework-requests-log
Version: 1.1.0
Summary: Robot Framework library for beautiful API request/response HTML log cards
License: MIT
Project-URL: Homepage, https://github.com/heynirinx/request-log-rf
Project-URL: Repository, https://github.com/heynirinx/request-log-rf
Keywords: robotframework,testing,api,http,logging,requests
Classifier: Programming Language :: Python :: 3
Classifier: Framework :: Robot Framework
Classifier: Framework :: Robot Framework :: Library
Classifier: Topic :: Software Development :: Testing
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: robotframework>=5.0
Requires-Dist: requests>=2.20
Dynamic: license-file

# robotframework-requests-log

A [Robot Framework](https://robotframework.org/) library that logs HTTP API requests and responses as beautiful interactive HTML cards — with color-coded method badges, status indicators, JSON syntax highlighting, and one-click curl commands.

## Features

- All HTTP methods: `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS`
- Color-coded method badges and status code indicators
- JSON syntax highlighting in request/response bodies
- Collapsible request/response headers
- Auto-generated curl command with copy button
- Binary content detection (images, PDFs, audio, video)
- Body truncation at 50KB with total size shown

## Installation

```bash
pip install robotframework-requests-log
```

## Usage

```robot
*** Settings ***
Library    RequestsLog

*** Test Cases ***
Test GET Request
    ${response}=    GET    https://jsonplaceholder.typicode.com/todos/1
    Log    ${response.status_code}

Test POST Request
    ${body}=    Create Dictionary    title=foo    body=bar    userId=${1}
    ${response}=    POST    https://jsonplaceholder.typicode.com/posts
    ...    json=${body}
    ...    expected_status=201
```

## Keywords

| Keyword | Description |
|---------|-------------|
| `GET` | Send an HTTP GET request |
| `POST` | Send an HTTP POST request |
| `PUT` | Send an HTTP PUT request |
| `PATCH` | Send an HTTP PATCH request |
| `DELETE` | Send an HTTP DELETE request |
| `HEAD` | Send an HTTP HEAD request |
| `OPTIONS` | Send an HTTP OPTIONS request |

### Common Parameters

| Parameter | Description | Default |
|-----------|-------------|---------|
| `url` | Target URL | required |
| `headers` | Additional headers (dict) | `None` |
| `json` | JSON body (dict) | `None` |
| `data` | Raw body | `None` |
| `params` | URL query parameters (dict) | `None` |
| `expected_status` | Assert response status code | `None` |
| `timeout` | Request timeout in seconds | `30` |
| `verify` | SSL certificate verification | `True` |
| `msg` | Custom error message on failure | `None` |

## Requirements

- Python >= 3.8
- Robot Framework >= 5.0
- requests >= 2.20

## License

MIT
