Answer the question
In order to leave comments, you need to log in
Rest api: what link to use for preview?
Please tell me which interface to use for validation and preview BEFORE creating or updating a record.
It is necessary that the user sees what he is typing with bb codes or markdown or some other complex markup. Accordingly, the model has two fields Text and RawText and only the server can make Text from RawText.
Ideally, there should be some kind of request in the body of which there will be only a model with empty fields. For example, to create, I could use
POST resources/with_empty_id
or
GET resources/with_empty_id,
but the get on the collection should return the collection itself, and the post will create/modify the record in the database.
It turns out that you definitely need to have something in the style:
GET resources/preview
Or with additional parameters in the request body? I also thought about the option with sessions (temporary id for records), but then some kind of passive service should be spinning that would clear expired sessions, I don’t have the opportunity to use this yet.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question