Skip to main content

Robot Framework library for beautiful API request/response HTML log cards

Project description

robotframework-requests-log

A Robot Framework 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

pip install robotframework-requests-log

Usage

*** 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robotframework_requests_log-1.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robotframework_requests_log-1.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file robotframework_requests_log-1.1.0.tar.gz.

File metadata

File hashes

Hashes for robotframework_requests_log-1.1.0.tar.gz
Algorithm Hash digest
SHA256 b3fbaf8454f42e2b491e43a4d429af8bdd70735c2c565fa990ac232162678507
MD5 32b1a6723cdbb2d7108c708f61a1718b
BLAKE2b-256 e901ddb3df738d4ffc5a3c479e3846162ae0adf7aae4ccfda408a7f659feaac1

See more details on using hashes here.

File details

Details for the file robotframework_requests_log-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_requests_log-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 687b964c8c2bec241addc09cea366f7277f74dfda0d17d7b57645ae99617f787
MD5 18fb89c216e3a6fa2de544c6ea958b57
BLAKE2b-256 3aa4ebef0abecdd3fbef1dbb9a4e7ec0e196cab140d4529635c29aee6ad5ae62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page