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.0.0.tar.gz (7.4 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.0.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for robotframework_requests_log-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d602a90e6c23865f9e7a24d6e4f65ac850133486ba8dce7c7fbef8a85bcaa398
MD5 c21ccf7e9cbcfaa64a54af28943d3816
BLAKE2b-256 2d6bf0cecb0170503a748ad050c80eb79238e5937884accfca7e1fa239cb3523

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for robotframework_requests_log-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87107d626554bf6f77ff4a61cb67558a2472ff6f71927ee3953146d0859a8b46
MD5 a801df169fc9c979d644960697339127
BLAKE2b-256 7b1a0fcbd270bc96f796bcd6d494290ed027049de96fc32e9453989f95c68a57

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