Replies: 3 comments 1 reply
-
I saw in another post in the Django Forum that you cannot POST to a Fobi form, but you would need to POST to a view and then apparently write some code to populate the Fobi form. I am confused, when you enter data into a Fobi form and submit it, I see in the terminal that it is a POST. For example I created a Fobi form and from the Dashboard entered data into that form and submitted. First I see a GET of /fobi/view/sample-_raining/ Then when I submit I see in the terminal, POST /fobi/view/sample-_raining/ HTTP/1.1" 302 0 and the 302 forwards to /fobi/view/sample-_raining/submitted/ which returns the "Success" page. So, why cannot I use PostMan or my own code to do that POST, and if it is easier to create my own View and use the DRF to post to that and then use python to populate the form, how would that be done? |
Beta Was this translation helpful? Give feedback.
-
I was able to populate my form with DRF using put http://localhost:8000/api/fobi-form-entry/sample_training/ using Postman with a raw body of JSON
It is a PUT not a POST which was my mistake looking through the docs for POST. |
Beta Was this translation helpful? Give feedback.
-
In most of the cases, if docs are not available, make sure to check the correspondent tests. https://github.com/barseghyanartur/django-fobi/blob/main/src/fobi/tests/test_drf_integration.py |
Beta Was this translation helpful? Give feedback.
-
I have Fobi forms working fine. Now I want to access the forms via Django REST Framework but cannot find documentation or examples. The doces say they are integrated but that is about it.
Thanks for your help.
Beta Was this translation helpful? Give feedback.
All reactions