我有这个邮递员:
显然我已经包含了昵称字段,但我的Laravel应用程序却不这么认为。我点击代码链接获取curl版本,然后返回:
curl -X POST \
http://192.168.1.143:8000/api/addresses/new \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Postman-Token: 507c0989-f02a-028c-4222-c91302402fd6' \
-H 'accept: application/x.toters.v1+json' \
-H 'accept-encoding: gzip' \
-H 'authorization: Bearer {***obfuscated***}' \
-H 'connection: Keep-Alive' \
-H 'content-language: en-US' \
-H 'content-length: 165' \
-H 'host: 192.168.1.143:8000' \
-H 'user-agent: Dalvik/2.1.0 (Linux; U; Android 8.1.0; Pixel 2 XL Build/OPM1.171019.018)' \
-d 'country_code=&street=&nickname=&lon=&phone_number=&is_default=&lat=&apartment=&building_ref='
注意-d
中的参数,它们已经消失了!我如何让邮差尊重我的参数?
这可以通过在curl中手动添加值来实现:
curl -X POST http://192.168.1.143:8000/api/addresses/new -H '缓存控制:无缓存' -H'内容类型: 应用程序/ x-WWW窗体-urlencoded' -H' Postman-Token: c04b38ca-c687-ACFC-C4C7-b54bd85a6018' -H'接受: 应用/ x.toters.v1 + JSON' -H'接受编码:gzip' -H 授权:持票人 {eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEwMiwiaXNzIjoiaHR0cDpcL1wvMTkyLjE2OC4xLjE0Mzo4MDAwXC9hcGlcL3VzZXJzXC9sb2dpbiIsImlhdCI6MTUyMDUxMjcxMSwiZXhwIjoxNjE1MTIwNzExLCJuYmYiOjE1MjA1MTI3MTEsImp0aSI6IkhzODRaamdjbnJEdlQ5Z3UifQ.TrFOeB5qKJ9DwWCqjDLSXXlBscBZKTtbogjWY_bLjdQ}' -H'连接:Keep-Alive' -H'内容语言:en-US' -H'主持人:192.168.1.143:8000' -H'用户代理:Dalvik / 2.1.0(Linux; U; Android 8.1.0; Pixel 2 XL Build / OPM1.171019.018)' -d“country_code = 657& street = toters& nickname = toters_office& lon = 35.5243772& lat = 33.8967797& phone_number = 96176447024& is_default = 1& apartment = toters& building_ref = toters”