Tencent / Tencent/Biny

使用 axios 发送POST 请求时,无法正常接收到数据

Open
#138 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
1.7k
Forks
253
PR merge metrics
No merged PRs in 30d

Description

ts 请求代码
function GetUser() { axios.post("/render/GetUser", { user: "111" }).then((res: any) => { console.log(res); }) }

PHP接收代码
public function action_GetUser(){ $user = $this->request->post("user"); $this->json([ "code"=>"00", "user"=>$user ]); }

请求返回
{"code":"00","user":null}

QQ截图20220811113747
QQ截图20220811113804
QQ截图20220811113908
QQ截图20220811113917

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the action_GetUser entry point and reproduce the TypeScript axios POST request shown in the issue. Inspect how the PHP request reads the posted user value and compare the received request with the response; done means the response contains user="111" instead of null.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.