#2 mORMot 1 » Send data to REST server via form-data » 2022-04-25 14:32:54

Edtech
Replies: 2

Hello,

I try to send files via form-data but I get a 406 error "sicPerSession execution failed (probably due to bad input parameters)" every time. I don't understand what arguments are expected by Synopse for this data format.

Also, MultiPartFormDataDecode seems to accept only files and no other form data. Moreover, it needs to be provided with a MimeType as a parameter which seems strange since the MimeType is already included in the form-data.

Anyway, if someone has an example of API with form-data...

Thanks in advance.

#3 Re: mORMot 1 » How to add global HTTP headers (like HSTS) to a REST server? » 2019-08-27 07:05:21

Ok for HSTS, but it's not natively in Synopse (I use TSQLRestServerDB). And if I want customize the other headers ?

#4 mORMot 1 » How to add global HTTP headers (like HSTS) to a REST server? » 2019-08-26 14:34:21

Edtech
Replies: 3

Hi!

I would add some HTTP headers to my REST server. I found how to add for each API but not to all the API.

For example, I would add the Strict-Transport-Security (HSTS) or Access-Control-Expose-Headers header.

#6 Re: mORMot 1 » Template for generating Swagger-UI-JSON » 2019-07-09 07:34:11

If I understand correctly, using TServiceCustomAnswer, I have to write my own wrapper to correctly generate the data to swagger?

#7 Re: mORMot 1 » Template for generating Swagger-UI-JSON » 2019-07-04 10:08:32

How do I declare my functions so that Swagger can correctly categorize them? Currently, I only have POSTs in the documentation while some functions are GET or DELETE.

My published functions are declared as follows:

function GET_xxxx(const AValue1, AValue2: RawUTF8): TServiceCustomAnswer;
function POST_xxxx(const AValue: RawUTF8): TServiceCustomAnswer;

Board footer

Powered by FluxBB