You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Gmail users.messages.trash returns 411 (Length Required) — missing Content-Length header on POST #182
gws gmail users messages trash always fails with HTTP 411 (Length Required). The Gmail API's trash endpoint is a POST method with no request body, but gws sends the request without a Content-Length: 0 header, causing Google's servers to reject it.
Steps to Reproduce
gws auth login
gws gmail +triage --max 1 --format json # works fine, get a message ID
gws gmail users messages trash --params '{"userId": "me", "id": "MESSAGE_ID"}'
Expected Behavior
The message should be moved to trash and the trashed message object returned.
This succeeds, confirming the API itself works — the issue is that gws omits the Content-Length header.
Scope
This likely affects all POST methods with no request body across all services, not just Gmail trash. Any Discovery API method where httpMethod: "POST" and no requestBody is defined will hit the same 411.
Other potentially affected methods (from schema inspection):
gmail.users.messages.untrash
gmail.users.threads.trash
gmail.users.threads.untrash
Any other body-less POST endpoint
Environment
gws version: 0.4.4
OS: macOS (Darwin 25.3.0)
Node.js: 22.x
Auth method: OAuth2 (plaintext credentials.json)
Suggested Fix
When building the HTTP request for POST methods with no request body, set Content-Length: 0 header explicitly.
Activity
fix(executor): add Content-Length: 0 header for body-less POST/PUT/PA…
fix(executor): add Content-Length: 0 for body-less POST requests (goo…
fix(executor): add Content-Length: 0 for body-less POST requests (goo…