When making a POST request in cURL mode or Node Fetch, it is converted to a GET request.
Example:
- Create a 30min postbin url from https://www.postb.in
- then test the popular novel function in cURL mode
- refresh the postbin site
- the request is a GET instead of a POST, and of course there isn't the form data
import{fetchApi}from'@libs/fetch';import{Plugin}from'@/types/plugin';constPOST_BIN_URL='https://www.postb.in/1761676424566-8950924063101';classTestimplementsPlugin.PluginBase{id='test';name='Test';site='';icon='';version='0.0.0';asyncpopularNovels(): Promise<Plugin.NovelItem[]>{constform=newURLSearchParams();form.append('keyword','hello');form.append('search','1');fetchApi(POST_BIN_URL,{method: 'POST',headers: {'Content-Type': 'application/x-www-form-urlencoded'},body: form.toString(),});return[];}asyncparseNovel(): Promise<Plugin.SourceNovel>{return{path: '',name: '',cover: '',chapters: [],}}asyncparseChapter(): Promise<string>{return'';}asyncsearchNovels(): Promise<Plugin.NovelItem[]>{return[];}}exportdefaultnewTest();
When making a POST request in cURL mode or Node Fetch, it is converted to a GET request.
Example: