[Lazarus] testing demorestbridge without a web server: is that possible?
duilio foschi
octopushole at gmail.com
Thu Oct 27 20:29:41 CEST 2022
Dear Zeljko,
>If this results in error 400-40xx
this is exactly what happens :)
c:\>curl -u Detlef:secret -H "Content-Type: application/json"
"http://localhost:3000/REST/metadata"
{
"error" : {
"code" : 404,
"message" : "NOT FOUND"
}
}
>then you must include connection after
REST
eg http://localhost:3000/REST/YOURDEFAULTCONNECTIONNAME/metadata
gulp! Which is my default connection name?
Thank you
Peppe
On Thu, Oct 27, 2022 at 7:13 PM zeljko <zeljko at holobit.hr> wrote:
>
>
>
> On 27. 10. 2022. 19:03, duilio foschi via lazarus wrote:
> > I tried to run demorestbridge inside Lazarus in debug mode.
> >
> > When the web browser points to
> > http://localhost:3000/REST/metadata
> >
> > the debugger shows an error message that says:
> >
> > 'project SQLDB REST bridge raised an exception of class 'EHTTP' with
> > message: No REQUEST_METHOD passed from server.. At address 10009D512'
> >
> > Any idea what this could mean?
>
> Yes, browsers by default do not send requested params (eg. request
> method). Use curl to test your server.
> eg
>
> curl -u YOURUSERNAME:PASSWORD -H "Content-Type: application/json"
> "http://localhost:3000/REST/metadata"
>
> curl by default set request method to GET.
> curl -u YOURUSERNAME:PASSWORD -H "Content-Type: application/json" -X
> GET "http://localhost:3000/REST/metadata"
>
> If this results in error 400-40xx then you must include connection after
> REST eg http://localhost:3000/REST/YOURDEFAULTCONNECTIONNAME/metadata
>
> zeljko
More information about the lazarus
mailing list