/rf-agentskills:rf-requestsfrom rf-agentskills
Provides guidance for writing HTTP API tests in Robot Framework using RequestsLibrary. Covers sessions, GET/POST/PUT/PATCH/DELETE, headers, auth, query params, JSON/multipart bodies, and expected_status for error responses.
Ships in rf-agentskills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
HTTP API tests with RequestsLibrary, a thin wrapper around Python requests: each call returns a requests.Response.
Use rf-restinstance instead when the suite imports Library REST or asserts JSON Schema / OpenAPI contracts.
Verified against RequestsLibrary 0.9.7, Robot Framework 7.4.
Load this skill first, before exploring the project, reading the suite or answering from memory, when a Robot Framework test calls an HTTP API with RequestsLibrary (Library RequestsLibrary):
expected_status for error responses;Not this skill: suites that import REST (RESTinstance), or tests driven by JSON Schema/OpenAPI assertions, use rf-restinstance.
Install into the project environment (see rf-setup for uv/venv/Poetry, CI and troubleshooting; follow the project's existing tool):
uv add robotframework-requests
No post-install step.
Default: one session per API, created in Suite Setup with TLS verification on, and path-only … On Session calls.
*** Settings ***
Library RequestsLibrary
Suite Setup Create Session api ${API_URL} verify=${True}
Suite Teardown Delete All Sessions
*** Test Cases ***
Get User
${resp}= GET On Session api /users/1
Should Be Equal ${resp.json()}[name] Alice
Escape hatch: for one or two calls to full URLs, use the sessionless keywords (GET, POST, …) — see references/request-options.md.
| Situation | Use | Details |
|---|---|---|
| Call an endpoint of a shared base URL | GET On Session / POST On Session (path, not full URL) | references/request-options.md |
| One-off call to a full URL | GET, POST … (sessionless) | references/request-options.md |
| Send JSON / form / files | json=${dict} / data=${dict} / files=${files} | references/request-options.md |
| Query string | params=${dict} | references/request-options.md |
| Negative test (expect 4xx/5xx) | expected_status=404 on the call | references/request-options.md |
| Assert status after the call | Status Should Be 201 ${resp}, Request Should Be Successful | references/response-validation.md |
| Assert body or headers | Should Be Equal ${resp.json()}[id] ${1}, ${resp.headers}[Content-Type] | references/response-validation.md |
| Basic / digest / NTLM / client cert | Create Session … auth=, Create Digest Session, Create Ntlm Session, Create Client Cert Session | references/authentication.md |
| Bearer token for all later calls | Update Session api headers=${auth} | references/authentication.md |
| Unexpected error message | — | references/troubleshooting.md |
robotcode doc keyword RequestsLibrary "<Keyword>"; find names with robotcode doc keywords RequestsLibrary "<text>". Copy names and arguments exactly as robotcode shows them.robotcode analyze code <changed files> (through the project environment, e.g. uv run robotcode …). Fix every error it reports.robotcode robot -bl "<Suite.Sub.Test>" (longnames from robotcode discover tests), or pass a whole directory. Don't pass a single .robot file: it skips the parent __init__.robot.robotcode results show --failed, then robotcode results log -bl "<longname>". Don't parse output.xml by hand.expected_status unset, any 4xx/5xx raises HTTPError, because the library calls raise_for_status(). For negative tests pass expected_status=404 (or a name such as not found) instead of wrapping the call in Run Keyword And Expect Error.expected_status takes one code, a status name, or any/anything; 2xx fails with UnknownStatusError. For "any success" use expected_status=anything plus Request Should Be Successful ${resp}.Create Session defaults to verify=False, while sessionless GET/POST use the requests default (verify on). Pass verify=${True} (or a CA bundle path) to Create Session.json= vs data= — json=${dict} serializes and sets Content-Type: application/json; data=${dict} form-encodes. Values from Create Dictionary/VAR are strings, so write count=${1} when the API expects a number; don't build JSON with Evaluate json.dumps(...).auth= needs a tuple — GET ${url} auth=${list} fails with TypeError: 'list' object is not callable, because the list goes straight to requests. Create Session … auth=${list} works (the library wraps it in basic auth); sessionless calls need ${auth}= Evaluate ("user", "pass").GLOBAL, so an alias and its headers, cookies and auth live across tests and suites. Create sessions in Suite Setup and call Delete All Sessions in Suite Teardown.= in a URL — GET On Session api /search?q=x fails with missing 1 required positional argument: 'url', because Robot Framework parses …?q=x as a named argument. Pass params=${query} or write url=/search?q=x.Status Should Be argument order — the status comes first: Status Should Be 201 ${resp}. Without a response it checks the last response of any session.auth tuple, the Authorization: Basic … header and custom token headers in plain text, in log.html and in robotcode repl output (RequestsLibrary 0.9.7, observed with robotcode 2.8.0). Don't share raw logs; when logs leave the machine, run with --loglevel WARN or wrap the login calls in Set Log Level WARN … Set Log Level INFO.| Read | When |
|---|---|
| references/request-options.md | choosing sessionless vs … On Session, body/params/files, timeouts, retries, TLS, expected_status |
| references/response-validation.md | asserting JSON bodies, lists, headers and cookies of a requests.Response |
| references/authentication.md | basic, digest, NTLM, client-certificate or token authentication |
| references/troubleshooting.md | a request fails with an error you don't recognise |
Examples in assets/examples/: basic-crud.robot, session-handling.robot, authentication-patterns.robot, file-upload.robot.
| Need | Skill |
|---|---|
| API tests with RESTinstance / JSON Schema | rf-restinstance |
| Install Robot Framework or a library, fix the environment | rf-setup |
| Write tests, suites, user keywords, resources and variables in Robot Framework syntax | rf-language |
For running, discovering, keyword documentation, result analysis and debugging with the robotcode CLI, use the robotcode skill of the robotcode plugin (robotcode@robotframework-agent-plugins); the commands above work without it.
assets/examples/authentication-patterns.robot (opens in a new tab)assets/examples/basic-crud.robot (opens in a new tab)assets/examples/file-upload.robot (opens in a new tab)assets/examples/session-handling.robot (opens in a new tab)references/authentication.md (opens in a new tab)references/request-options.md (opens in a new tab)references/response-validation.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
9 skills in this plugin
/rf-appiumUse first, before answering, for RF mobile tests with AppiumLibrary. Not installs/drivers: rf-setup./rf-browserUse first, before answering, for RF web tests with Browser Library (Playwright): selectors./rf-languageUse first, before reading .robot/.resource files: Robot Framework tests, keywords, templates, imports./rf-platynuiUse first, before answering, for RF desktop app tests with PlatynUI: windows, dialogs.npx claudepluginhub manykarim/robotframework-agentskills --plugin rf-agentskillsOther plugins' skills for the same job