Logo Rf Requests

Rf Requests

Cộng đồng
manykarim
rf-requests

Use first, before answering, for RF HTTP API tests with RequestsLibrary: sessions.

Tổng quan

Nhà phát hànhmanykarim
Kho mãrobotframework-agentskills
Tên kỹ năngrf-requests
Sao
40
Bản fork
2
Tệp đi kèm
8
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 8 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được manykarim công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Rf Requests trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/manykarim/robotframework-agentskills/tree/main/plugins/rf-agentskills/skills/rf-requests
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/manykarim/robotframework-agentskills.git /tmp/robotframework-agentskills
mkdir -p .claude/skills
cp -r /tmp/robotframework-agentskills/plugins/rf-agentskills/skills/rf-requests .claude/skills/rf-requests
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Rf Requests trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Rf Requests ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Rf Requests không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Requests Library Skill

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.

When to use

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):

  • writing new API tests for an endpoint, or adding a check on a field of the JSON response;
  • sessions, GET/POST/PUT/PATCH/DELETE, headers, bearer or basic auth, query parameters, JSON and multipart bodies, expected_status for error responses;
  • a failing request (HTTPError, wrong status, SSL, timeouts);
  • API tests in Robot Framework without naming a library: RequestsLibrary is the default.

Not this skill: suites that import REST (RESTinstance), or tests driven by JSON Schema/OpenAPI assertions, use rf-restinstance.

Installation

Install into the project environment (see rf-setup for uv/venv/Poetry, CI and troubleshooting; follow the project's existing tool):

bash
uv add robotframework-requests

No post-install step.

Import and defaults

Default: one session per API, created in Suite Setup with TLS verification on, and path-only … On Session calls.

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

Which keyword for which situation

SituationUseDetails
Call an endpoint of a shared base URLGET On Session / POST On Session (path, not full URL)references/request-options.md
One-off call to a full URLGET, POST … (sessionless)references/request-options.md
Send JSON / form / filesjson=${dict} / data=${dict} / files=${files}references/request-options.md
Query stringparams=${dict}references/request-options.md
Negative test (expect 4xx/5xx)expected_status=404 on the callreferences/request-options.md
Assert status after the callStatus Should Be 201 ${resp}, Request Should Be Successfulreferences/response-validation.md
Assert body or headersShould Be Equal ${resp.json()}[id] ${1}, ${resp.headers}[Content-Type]references/response-validation.md
Basic / digest / NTLM / client certCreate Session … auth=, Create Digest Session, Create Ntlm Session, Create Client Cert Sessionreferences/authentication.md
Bearer token for all later callsUpdate Session api headers=${auth}references/authentication.md
Unexpected error message—references/troubleshooting.md

Agent workflow

  1. Look up each keyword before you use it: robotcode doc keyword RequestsLibrary "<Keyword>"; find names with robotcode doc keywords RequestsLibrary "<text>". Copy names and arguments exactly as robotcode shows them.
  2. Write the test with the defaults above and the decision table.
  3. Check the changed files statically: robotcode analyze code <changed files> (through the project environment, e.g. uv run robotcode …). Fix every error it reports.
  4. Run them by longname: 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.
  5. Read the results: robotcode results show --failed, then robotcode results log -bl "<longname>". Don't parse output.xml by hand.
  6. Fix the cause and go back to step 3 (static check). Stop when the tests pass or the failure is shown to be in the system under test, and say which.

Gotchas

  • Every call asserts the status — with 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.
  • No status ranges — 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}.
  • Sessions skip TLS verification — 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(...).
  • Sessionless 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").
  • Sessions are global — the library scope is 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.
  • Credentials are logged at INFO — session creation and each request log the 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.

When to read the references

ReadWhen
references/request-options.mdchoosing sessionless vs … On Session, body/params/files, timeouts, retries, TLS, expected_status
references/response-validation.mdasserting JSON bodies, lists, headers and cookies of a requests.Response
references/authentication.mdbasic, digest, NTLM, client-certificate or token authentication
references/troubleshooting.mda 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.

Companion Skills

NeedSkill
API tests with RESTinstance / JSON Schemarf-restinstance
Install Robot Framework or a library, fix the environmentrf-setup
Write tests, suites, user keywords, resources and variables in Robot Framework syntaxrf-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.

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Rf Requests làm được gì?

Use first, before answering, for RF HTTP API tests with RequestsLibrary: sessions.

Vì sao nên dùng Rf Requests trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Rf Requests là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Rf Requests trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/manykarim/robotframework-agentskills/tree/main/plugins/rf-agentskills/skills/rf-requests. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Rf Requests?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Rf Requests với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Rf Requests với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Rf Requests có miễn phí không?

Có. Kỹ năng này được manykarim phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇