尽管有404响应,但卷曲PUT上传成功

时间:2019-02-08 15:54:04

标签: curl file-upload webserver ngrok

我正在使用ngrok转发到Web服务器,并且希望能够将文件上传到其中。运行curl <my_ngrok_subdomain>.com --upload-file test.txt时,curl似乎可以成功上传,但是我不确定为什么它返回404:

这不是很冗长,这使我认为它是成功的:

$ curl  blahblahblah.ngrok.io --upload-file test.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    49  100    35  100    14     30     12  0:00:01  0:00:01 --:--:--    42
Tunnel blahblahblah.ngrok.io not found

所以看起来好像文件已成功上传,但这是启用了详细说明的curl,这让我不确定...

$curl --verbose blahblahblah.ngrok.io --upload-file test.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying XX.XX.XX.XX...
* TCP_NODELAY set
* Connected to blahblahblah.ngrok.io (XX.XX.XX.XX) port 80 (#0)
> PUT /test.txt HTTP/1.1
> Host: blahblahblah.ngrok.io
> User-Agent: curl/7.58.0
> Accept: */*
> Content-Length: 14
> Expect: 100-continue
> 
* Done waiting for 100-continue
  0    14    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0} [14 bytes data]
* We are completely uploaded and fine
< HTTP/1.1 404 Not Found
< Content-Length: 35
< Content-Type: text/plain
< 
{ [35 bytes data]
100    49  100    35  100    14     30     12  0:00:01  0:00:01 --:--:--    42
* Connection #0 to blahblahblah.ngrok.io left intact
Tunnel blahblahblah.ngrok.io not found.

尽管返回了404,是否有可能成功完成curl上传?

0 个答案:

没有答案