#1 2025-09-25 21:20:13

alexkam75
Member
Registered: 2020-01-28
Posts: 6
Website

Http request does not work

Hi!
In the examples mORMot2\ex\ThirdPartyDemos\martin-doyle, the request:
http://localhost:11111/root/sample does not work. It returns the following result:
{
    "errorCode": 404,
    "errorText": "Not Found"
}

Previously, the result of the request was a list of sample object IDs.
Is this a bug?

In the example:
mORMot2\ex\ThirdPartyDemos\martin-doyle\04-InterfacedBasedServices,
when making a POST request to:
http://localhost:11111/root/Example/Add
with the header "Content-Type: application/json" and sending the object:
{"Name": "Name 1", "Question": "Question 1"}

The database inserts empty values instead, as shown below:
insert into Sample (Name, Question, Time) values (:(''):,:(''):,:(135932236896):)

What should be done to resolve this issue?

Offline

#2 2025-09-26 07:46:43

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

Re: Http request does not work

Which example are you talking about in your first remark?
You are using /sample then /example

The REST endpoint to access the ORM is likely to be just disabled.
As it should with interface based services: you should not publish the ORM tables AND the interface based services at the same time.

Offline

#3 2025-09-26 08:37:35

alexkam75
Member
Registered: 2020-01-28
Posts: 6
Website

Re: Http request does not work

1. mORMot2\ex\ThirdPartyDemos\martin-doyle\02-HttpClientServerORM

2. mORMot2\ex\ThirdPartyDemos\martin-doyle\04-InterfacedBasedService
When creating an object, JSON is not passed in the HTTP request.
http://localhost:11111/root/Example/Add

Last edited by alexkam75 (2025-09-26 08:39:08)

Offline

#4 2025-09-26 16:08:05

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

Re: Http request does not work

Take a look at the mORMot 1 documentation about the differences between:
1) REST access to the ORM tables
2) method-based services
3) interface-based services.

To understand more about what to expect or not depending on how you initialize the server side.

Offline

Board footer

Powered by FluxBB