LLM Skills
~/catalogue/debugging et maintenance//SKILL

Reqwest-form-feature-required

/SKILL

Correction des erreurs "aucune méthode nommée `form` trouvée" ou "utilisation de la méthode non résolue `form`".

// contenu du skill

name: reqwest-form-feature-required

description: |

Fix for "no method named form found" or "use of unresolved method form" errors

when using reqwest in Rust. Use when: (1) reqwest .form() method not found at compile

time, (2) sending URL-encoded form data to APIs like OAuth token endpoints,

(3) upgrading from older reqwest versions where form worked without feature flag.

The form feature must be explicitly enabled in Cargo.toml for reqwest 0.11+.

author: Claude Code

version: 1.0.0

date: 2026-01-23


reqwest Form Feature Required

Problem

When using reqwest to send form-encoded data (like OAuth token requests), the .form()

method may not be available, causing confusing compiler errors that suggest the method

doesn't exist.

Context / Trigger Conditions

Error messages you'll see:

error[E0599]: no method named `form` found for struct `RequestBuilder` in the current scope

or

error[E0599]: no variant or associated item named `form` found
help: there is a method `or` with a similar name

Common scenarios:

  • Making OAuth2 token refresh/exchange requests
  • Submitting form data to APIs that expect application/x-www-form-urlencoded
  • Migrating code from reqwest < 0.11 where form was available by default
  • Using workspace dependencies where not all features are inherited

Solution

Add the form feature to your reqwest dependency in Cargo.toml:

toml
# Single crate
reqwest = { version = "0.13", features = ["form"] }

# With other common features
reqwest = { version = "0.13", features = ["json", "form", "rustls"] }

# In workspace Cargo.toml
[workspace.dependencies]
reqwest = { version = "0.13", default-features = false, features = ["json", "form", "rustls", "http2"] }

Note: In reqwest 0.11+, many methods are behind feature flags:

  • json - for .json() method
  • form - for .form() method
  • multipart - for multipart form uploads
  • cookies - for cookie jar support
  • stream - for streaming request/response bodies

Verification

After adding the feature, run cargo check and the error should be resolved:

bash
cargo check
# Should compile without the "no method named form" error

Example

Before (fails to compile):

rust
let response = client
    .post("https://oauth2.googleapis.com/token")
    .form(&[
        ("client_id", "xxx"),
        ("client_secret", "yyy"),
        ("grant_type", "refresh_token"),
    ])
    .send()
    .await?;

Fix in Cargo.toml:

toml
[dependencies]
reqwest = { version = "0.13", features = ["form"] }

Notes

  • This is a common gotcha when using default-features = false with reqwest
  • The error message suggests or as an alternative method, which is misleading
  • When using workspace dependencies, ensure features are properly propagated to member crates
  • The form method serializes data as application/x-www-form-urlencoded
  • For file uploads, use multipart feature and .multipart() method instead

References

// source originale publique
strataga/claude-setup
/skills/reqwest-form-feature-required/SKILL.md
Licence : Licence non indiquée. Consultez le dépôt avant toute réutilisation.
Projet indépendant, non affilié à Anthropic. Ce skill reste la propriété de son auteur original.
// installer ce skill
Collez cette commande dans votre terminal à la racine de votre projet :
mkdir -p .claude/commands && curl -o ".claude/commands/SKILL.md" "https://raw.githubusercontent.com/strataga/claude-setup/master/skills/reqwest-form-feature-required/SKILL.md"
Ensuite dans Claude Code, tapez /SKILL pour l'activer.
open_in_newVoir la source originale
// sauvegarder
Sauvegarde disponible après connexion.
loginSe connecter pour sauvegarder
// informations
Créateurstrataga
Format.md
AccèsGratuit
// similaires

Skills Debugging et maintenance

Voir toutarrow_forward