Full body not shown #5

Closed
opened 2025-08-24 09:25:08 +00:00 by mybigman · 6 comments

Apologies mate whilst that issue is fixed theres something else. It doesnt receive the full body?

curl -v -X POST localhost:8080 -H "Content-Type: application/json" -d '{"name": "sample", "time": "Wed, 21 Oct 2015 18:27:50 GMT"'
Raw body: {"name": "sample", "time": "Wed

Originally posted by @mybigman in #4 (comment)

Apologies mate whilst that issue is fixed theres something else. It doesnt receive the full body? ```bash curl -v -X POST localhost:8080 -H "Content-Type: application/json" -d '{"name": "sample", "time": "Wed, 21 Oct 2015 18:27:50 GMT"' ``` ```go Raw body: {"name": "sample", "time": "Wed ``` _Originally posted by @mybigman in https://git.urbach.dev/go/web/issues/4#issuecomment-215_
Owner

I can't reproduce that here.

Could it be that your curl sends it via Transfer-Encoding: chunked instead of a single Content-Length chunk?
This is currently not implemented in the server and there are no plans to add it from my side, though I would accept a well-made PR.

But regardless, my curl here sends the entire string.
Maybe it works on your side if you close the JSON object?

curl -v -X POST localhost:8080 -H "Content-Type: application/json" -d '{"name": "sample", "time": "Wed, 21 Oct 2015 18:27:52 GMT"}'
I can't reproduce that here. Could it be that your `curl` sends it via `Transfer-Encoding: chunked` instead of a single `Content-Length` chunk? This is currently not implemented in the server and there are no plans to add it from my side, though I would accept a well-made PR. But regardless, my `curl` here sends the entire string. Maybe it works on your side if you close the JSON object? ```shell curl -v -X POST localhost:8080 -H "Content-Type: application/json" -d '{"name": "sample", "time": "Wed, 21 Oct 2015 18:27:52 GMT"}' ```
Author

Apologies again mate seems it was some cache issue my end. After clean reinstall problem does not exist

Apologies again mate seems it was some cache issue my end. After clean reinstall problem does not exist
Author

Sorry, I am still experiencing it.

Verbose

curl -vvv -X POST localhost:8080 -H "Content-Type: application/json" -d '{"name": "sample", "time": "Wed, 21 Oct 2015 18:27:50 GMT"'
Note: Unnecessary use of -X or --request, POST is already inferred.
* Host localhost:8080 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8080...
* Connected to localhost (::1) port 8080
> POST / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/8.7.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 58
>
* upload completely sent off: 58 bytes
< HTTP/1.1 200
< Content-Length: 10
<
* Connection #0 to host localhost left intact
Hello Post

response

Raw body: {"name": "sample", "time": "Wed, 21 Oct 2015 18:27:50 GMT"

vscode rest client

POST {{host}} HTTP/1.1
Content-Type: {{contentType}}
Content-Length: 300

{
    "name": "sample",
    "time": "Wed, 21 Oct 2015 18:27:50 GMT"
}

response

Raw body: {
    "name": "sample",
    "time": "Wed, 21 Oct 2015 18:2
Sorry, I am still experiencing it. Verbose ```bash curl -vvv -X POST localhost:8080 -H "Content-Type: application/json" -d '{"name": "sample", "time": "Wed, 21 Oct 2015 18:27:50 GMT"' Note: Unnecessary use of -X or --request, POST is already inferred. * Host localhost:8080 was resolved. * IPv6: ::1 * IPv4: 127.0.0.1 * Trying [::1]:8080... * Connected to localhost (::1) port 8080 > POST / HTTP/1.1 > Host: localhost:8080 > User-Agent: curl/8.7.1 > Accept: */* > Content-Type: application/json > Content-Length: 58 > * upload completely sent off: 58 bytes < HTTP/1.1 200 < Content-Length: 10 < * Connection #0 to host localhost left intact Hello Post ``` response ```go Raw body: {"name": "sample", "time": "Wed, 21 Oct 2015 18:27:50 GMT" ``` vscode rest client ``` POST {{host}} HTTP/1.1 Content-Type: {{contentType}} Content-Length: 300 { "name": "sample", "time": "Wed, 21 Oct 2015 18:27:50 GMT" } ``` response ```go Raw body: { "name": "sample", "time": "Wed, 21 Oct 2015 18:2 ```
Owner

Edit: I can reproduce some of the problems seemingly depending on the length of the string.

*Edit*: I can reproduce some of the problems seemingly depending on the length of the string.
Owner

Fixed in 3a0a0ae840.

go get git.urbach.dev/go/web@3a0a0ae840
Fixed in https://git.urbach.dev/go/web/commit/3a0a0ae8400951f27379b795ea2bf7c3400d0276. ```shell go get git.urbach.dev/go/web@3a0a0ae840 ```
ed self-assigned this 2025-08-24 10:25:11 +00:00
ed added spent time 2025-08-24 10:25:29 +00:00
20 minutes
Author

thanks mate seems resolved.

tested using curl, http and rest client

Raw body: {"name": "sample", "time": "Wed, 21 Oct 2015 18:27:50 GMT"}
Raw body: {"name": "sample", "time": "Wed, 21 Oct 2015 18:27:50 GMT"}
Raw body: {"field":"value","time":"Wed, 21 Oct 2015","other":"super long string of nothing, super long string of nothing"}
Raw body: {"field":"value","time":"Wed, 21 Oct 2015","other":"super long string of nothing, super long string of nothing"}
Raw body: {
    "name": "sample",
    "time": "Wed, 21 Oct 2015 18:27:50 GMT"
}
Raw body:
{
    "name": "sample",
    "time": "Wed, 21 Oct 2015 18:27:50 GMT"
}
thanks mate seems resolved. tested using curl, http and rest client ``` Raw body: {"name": "sample", "time": "Wed, 21 Oct 2015 18:27:50 GMT"} Raw body: {"name": "sample", "time": "Wed, 21 Oct 2015 18:27:50 GMT"} Raw body: {"field":"value","time":"Wed, 21 Oct 2015","other":"super long string of nothing, super long string of nothing"} Raw body: {"field":"value","time":"Wed, 21 Oct 2015","other":"super long string of nothing, super long string of nothing"} Raw body: { "name": "sample", "time": "Wed, 21 Oct 2015 18:27:50 GMT" } Raw body: { "name": "sample", "time": "Wed, 21 Oct 2015 18:27:50 GMT" } ```
ed closed this issue 2025-08-24 10:47:31 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Total time spent: 20 minutes
ed
20 minutes
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: go/web#5
No description provided.