{"id":3792,"library":"robotframework-requests","title":"Robot Framework Requests Library","description":"robotframework-requests is a Robot Framework keyword library that wraps the popular Python Requests library, providing HTTP API testing functionalities. It is actively developed, with a stable `0.9.x` series and an ongoing `1.0aX` pre-release series introducing significant changes and new features.","status":"active","version":"0.9.7","language":"en","source_language":"en","source_url":"https://github.com/MarketSquare/robotframework-requests","tags":["robot framework","http","api testing","requests","automation"],"install":[{"cmd":"pip install robotframework-requests","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core dependency for any Robot Framework library.","package":"robotframework","optional":false},{"reason":"The underlying HTTP library that robotframework-requests wraps.","package":"requests","optional":false}],"imports":[{"note":"Robot Framework libraries are imported in the '*** Settings ***' section of a .robot file, not directly in Python code.","symbol":"RequestsLibrary","correct":"*** Settings ***\nLibrary    RequestsLibrary"}],"quickstart":{"code":"*** Settings ***\nLibrary    RequestsLibrary\n\n*** Test Cases ***\nQuick Get Request Example\n    ${response}=    GET    https://jsonplaceholder.typicode.com/posts/1\n    Status Should Be    200    ${response}\n    Should Be Equal As Strings    1    ${response.json()}[id]\n    Log To Console    Response Body: ${response.json()}","lang":"robotframework","description":"This quickstart demonstrates a basic GET request to a public API using sessionless keywords (available since v0.9). It retrieves a post, asserts the HTTP status code, and verifies a specific field in the JSON response."},"warnings":[{"fix":"Migrate your test environment to Python 3.6+.","message":"Python 2 support has been removed in `v1.0a10` and later versions. Users on Python 2 must either upgrade to Python 3 or stick to older `0.9.x` releases.","severity":"breaking","affected_versions":">= 1.0a10"},{"fix":"Update your test cases to use the new keyword structure. For example, replace `Get Request` with `GET` or `GET On Session`.","message":"Many old keywords (e.g., `Get Request`, `Post Request`) are deprecated and will be removed in `v1.0.0` in favor of new keywords (e.g., `GET`, `POST`, `GET On Session`, `POST On Session`). The new keywords offer improved parameter alignment with the underlying `requests` library.","severity":"breaking","affected_versions":">= 0.8.0, < 1.0.0 (deprecated); >= 1.0.0 (removed)"},{"fix":"Add `expected_status=any` or the specific expected error code to your HTTP request keywords when testing for non-2xx responses.","message":"Keywords like `GET On Session` or `POST On Session` implicitly fail if an error status code (e.g., 4xx, 5xx) is returned by default. To test for expected error responses (negative testing), you must explicitly set the `expected_status` parameter (e.g., `expected_status=any` or `expected_status=404`).","severity":"gotcha","affected_versions":">= 0.8.0"},{"fix":"Be aware of logging output. For sensitive data, consider configuring Robot Framework's logging levels, sanitizing outputs, or using external secret management where possible. `1.0a12` includes a fix for basic authentication leakage with specific keyword usage, but general logging awareness is still crucial.","message":"Sensitive information, such as Authorization headers containing API keys or tokens, is logged by default. This can lead to security vulnerabilities if logs are not properly secured.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade to `0.9.7` or later for file descriptor fixes. If using `1.0aX` pre-releases and uploading file lists, upgrade to `1.0a13` or later.","message":"There was an issue where file descriptors might not be closed correctly when using the `files` parameter, potentially leading to resource leaks. Additionally, uploading files as a list was broken in some `1.0aX` versions.","severity":"gotcha","affected_versions":"< 0.9.7 (file descriptor issue); 1.0aX (list upload issue fixed in 1.0a13)"},{"fix":"When using the `auth` parameter directly in `GET` (or other sessionless requests), ensure it is provided as a 2-length tuple, e.g., `auth=('username', 'password')`.","message":"The `auth` parameter for authentication can be inconsistent. `Create Session` may accept an iterable (e.g., list or tuple), but non-session keywords like `GET` typically expect a 2-length tuple specifically for HTTP Basic Authentication.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}