I'm working on a search feature. When user enters a keyword, they should get a list of brands.
The current URL is http://127.0.0.1:8000/brand/list
If I search for "bag", it should be http://127.0.0.1:8000/brand/list?keyword=bag
But now, it's http://127.0.0.1:8000/brand/list/GET?keyword=bag. I wanna remove the GET? thing. How can I do this?
<section id="brand-list">
<form action="GET">
<input type="text" name="keyword">
<button>Search</button>
</form>
</section>
CodePudding user response:
You specified this as , this is the URL where the form will submit to, you should specify action="GET"method="GET", or just nothing, since that is the default method, so:
<section id="brand-list">
<form method="GET">
<input type="text" name="keyword">
<button>Search</button>
</form>
</section> 