I'm getting -400 error (CACHE_MISS) when navigating Back and then Forward in navigation history after a POST request was made. What is the best way to resend the POST request when navigating in browser history? I've tried calling Reload() in OnLoadError(), but it causes history navigation to be broken, the entry before POST request disappears from navigation history.
Here are the steps in my app (branch 1650):
1. GET index.php
2. GET foo.php
3. POST foo.php?bar=1
4. Back()
5. Forward() - OnLoadError is called with -400 error.
a) Doing Back() in that callback takes us to step 1) GET index.php.
b) Doing Reload() resents the post request, repeats step 3) POST foo.php
What happens after 5) > b):
6. Calling Back() takes us back to step 1) GET index.php
What should happen after 5) > b):
6. Calling Back() should take us back to step 2) GET foo.php
Here are the steps in cefclient (branch 2170):
(steps 1-4 are the same)
1. GET index.php
2. GET foo.php
3. POST foo.php?bar=1
4. Back()
5. Forward() - Getting error "Failed to load URL http://127.0.0.1:54305/foo.php?bar=1 with error (-400).".
6. Back() takes us back to step 2) GET foo.php
7. Forward() - resents the 3) request but with GET method instead of POST. It makes GET foo.php?bar=1
What I would like is to:
1) Resend the original POST request when doing Back/Forward navigation. I don't want to display -400 error message to user
2) Not to lose any navigation history.
Any ideas on how to accomplish this?