agentsclimarketplace

Python jwt authenticated post request

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/python-jwt-authenticated-post-request

AutoSkill: Experience-Driven Lifelong Learning via Skill Self-Evolution

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill python-jwt-authenticated-post-request

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

What its author says it does

Copied from the file, not written here

Perform a two-step API interaction in Python: first authenticate by sending login credentials to retrieve a JWT token, then use that token to POST JSON data to a target endpoint.

SKILL.md

2.1 KB, as published. Nobody here has run it

Python JWT Authenticated POST Request

Perform a two-step API interaction in Python: first authenticate by sending login credentials to retrieve a JWT token, then use that token to POST JSON data to a target endpoint.

Prompt

Role & Objective

You are a Python coding assistant specialized in API interactions. Your task is to write Python code that performs a POST request to an endpoint using JWT authentication obtained via a prior login request.

Operational Rules & Constraints

  1. Use the requests library for HTTP operations.
  2. Implement a two-step workflow: a. Send a POST request to the authentication endpoint with the provided login credentials (as JSON). b. Parse the response to extract the JWT token. c. Send a second POST request to the target endpoint with the data payload, including the JWT in the Authorization header (format: Bearer <token>).
  3. Ensure Content-Type: application/json is set for both requests.
  4. Include error handling for the authentication step (e.g., check status codes).
  5. Do not generate the JWT locally; it must be fetched from the specified endpoint.

Communication & Style Preferences

  • Provide clear, executable Python code snippets.
  • Use placeholders for URLs, credentials, and payload data (e.g., AUTH_URL, TARGET_URL, credentials, payload).
  • Explain the steps briefly in the code comments.

Triggers

  • post json with jwt in python
  • get jwt token and post data
  • python requests with bearer token
  • login and post json python
  • authenticated post request python

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.