Skip to content

[iOS] Web.Delete sends GET instead of DELETE when no body is provided #3612

@EllaChang1011

Description

@EllaChang1011

Describe the bug

On iOS Companion, the Web component’s Delete block sends a GET request when no body is provided. This causes servers to treat the call as a read instead of a delete.

Affects

  • Designer
  • Blocks editor
  • Projects Explorer
  • Android Companion
  • iOS Companion
  • Android Compiled APK/AAB
  • iOS Compiled IPA
  • Buildserver
  • Debugging
  • Other... (please describe)

Expected behavior

Calling Web.Delete should send an HTTP request with method = "DELETE" (body optional, typically none).
The method must not fall back to "GET" when the body is absent.

Steps to reproduce

  1. Create a project with a Web component.
  2. Set Web.Url to a test endpoint, e.g. https://httpbin.org/delete (or your Beeceptor endpoint).
  3. Trigger the Web.Delete block.
  4. Inspect the received request on the server/test endpoint.

Actual result
Observed method = GET instead of DELETE when no request body is provided.


Additional context / suspected cause

In iOS implementation (components-ios/AIComponentKit/Web.swift), request.httpMethod is only set when a body is present (e.g., POST/PUT).
When postData and postFile are both nil (typical for DELETE), the code never sets httpMethod, so URLRequest defaults to "GET".

Proposed fix: set request.httpMethod = httpVerb unconditionally before handling the (optional) body.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions