#1 2026-01-09 19:45:23

mrbar2000
Member
From: Brazil
Registered: 2016-10-26
Posts: 116

Why PUT and Delete dont work anymore?

I have update my sources, it is very old!

Now my application dont accept PUT and DELETE. just Get and POST

Offline

#2 Yesterday 09:42:52

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,372
Website

Re: Why PUT and Delete dont work anymore?

On which part of the framework?
REST-methods? REST-interfaces? MVC?
Please always debug a little and give some context.

There was some tuning to reduce memory usage and CPU consumption at startup.
But it should not affect regular process.

Offline

#3 Yesterday 12:30:55

mrbar2000
Member
From: Brazil
Registered: 2016-10-26
Posts: 116

Re: Why PUT and Delete dont work anymore?

Rest Interfaces.
I put .AcceptMethods([mGet,mPUT,mPost,mDelete]) in my registerservice. and now works.

I dont know if is the better  place, but works. was hours of debug and looking mormot code! I look at documentation but i cannot found nothing about!

Offline

#4 Yesterday 17:05:19

JD
Member
Registered: 2015-08-20
Posts: 128

Re: Why PUT and Delete dont work anymore?

I have the same problem. I have an old mORMot 2.3.11038 which works, and I wanted to update it, I've tried mORMot 2.3.13041 and mORMot 2.3.13309, but I had to go back to my old version because PUT does not work in my REST interface server.

Initially trying to do a PUT in one of those versions gave me a 401 Unauthorized error, but the last one gives a 405 Method Not Allowed error.

@mbar2000 Where did you add the AcceptMethods([mGet,mPUT,mPost,mDelete]) to the service?

Thanks,

JD

Offline

#5 Yesterday 18:43:07

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,372
Website

Re: Why PUT and Delete dont work anymore?

I guess he meant TServiceFactoryServerAbstract.SetMethods() as documented:

    /// define the HTTP methods used for TRestServerUriContext.UriComputeRoutes
    /// - by default, only [mGET, mPOST] are allowed, but you can set any other
    // set, e.g. [mGET, mPOST, mPUT, mDELETE] if you want to allow more HTTP verbs
    // - this method returns self in order to allow direct chaining of settings
    // calls, in a fluent interface
    function SetMethods(const aMethods: TUriMethods): TServiceFactoryServerAbstract;

Offline

Board footer

Powered by FluxBB