go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

When the content type is not standard can not reader the params

Open rundaisc opened this issue 2 years ago • 2 comments
trafficstars

The request header from others image

The Api description

type DeviceInfo {
    DevName string  `json:"dev_name"` //设备名称
    Ip string  `json:"ip"` //设备ip
    Sn string  `json:"sn"` //设备序号
}

Expected behavior In this case we can not get body params . I has checked the code in package. we use the application/json as Json header only .
` image

**Environments **

  • go-zero version [1.5.3]

I has setup the header to application/json manuly before read body as the temporary solution.

Can do something compatible from the header ? because we dont know others api is standard or not

rundaisc avatar Jul 13 '23 08:07 rundaisc

You mean with upper case J?

kevwan avatar Jul 13 '23 14:07 kevwan

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jul 15 '24 01:07 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Oct 14 '24 02:10 github-actions[bot]