Skip to content

Body payload is appending to the url query string instead of request body #75

Description

@eddypjr

When can-ajax is used with the PATCH method, the body payload should append to the request body, not the url query string.

  • POST and PUT are working as expected, but sending a JSON payload with PATCH is not.
  • ajax({ url: ``${loader.serviceBaseURL}/carrito_articulo?${pk.toString()}``, type: 'PATCH', data: {foo: 'bar'} })

Activity

  1. gregorgodoy commented on Nov 11, 2021

    @gregorgodoy

    I think we have to change line 221

    from

    var isPost = type === "POST" || type === "PUT"
    

    to

    var isPost = type === "POST" || type === "PUT" || type === "PATCH"
    

    I tried it locally and works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions