Skip to content

[DEV] POST request doesn't work in cURL or node fetch mode #1863

Description

@error7404

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();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions