Nk.register_rpc in lua does not accept PUT requests and returns an error {"code":12,"message":"Method Not Allowed"} is there a way to make the server accept PUT requests?

Hello! I am implementing a shopping cart system which consists of two steps: 1) Create a payment by sending a POST request to the Nakama server. 2) Complete the payment by sending a PUT request. I have a problem: I found that the POST request and the payment creation are working fine, but it seems that nk.register_rpc in lua does not accept PUT requests and gives an error {“code”:12,“message”:“Method Not Allowed”}. Do I need to implement my own RPC in Go or is there another way to make the server accept PUT requests?

Hello @gamemania1000000,

The RPCs registered through Nakama only accept POST or GET methods.
Could you rework it to use POST instead?

Best.

I can’t influence this because the partner company uses PUT to complete the payment. As I understand, the only option is to make a custom module on go to accept PUT?

Currently you’d have to register a raw http handler using the RegisterHttp function (nakama/sample_go_module/sample.go at master · heroiclabs/nakama · GitHub).

If authentication should be required, you’d have to implement it yourself as well.