how to get request parameter of patch request

72
May 15, 2018, at 6:30 PM

I'm trying to make an AJAX request by PATCH method, but I get error message "Required String parameter 'paymentPassword' is not present". How to bind the paymentPassword parameter? If I change HTTP request method to POST and @PatchMapping to @PostMapping, @RequestParam will work.

JavaScript code performing PATCH request:

$.ajax("http://localhost:8080/Api/Order/201805152000520002/pay", {
    method: "PATCH",
    data: {paymentPassword: "..."},
    success: function (res) {
        console.log(arguments)
    }
}

SpringMvc controller method:

@PatchMapping(value = "/{orderID}/pay")
public Map pay(@SessionAttribute("user") User user
        , @PathVariable("orderID") String orderID
        , @RequestParam("paymentPassword") String paymentPassword){...}
READ ALSO
SingalR Error during negotiation request

SingalR Error during negotiation request

I've got a project with SignalR and AspNetI'm trying to connect my client (its a cors) and the first request returns 200 code but I'm getting this error in my client side:

36
Date on page load is empty

Date on page load is empty

I have inline datepickers in my ViewI using air-datepickers

59