This code fragment parses a simulated POST request with one parameter. It appears that the parser is appending an unwanted newline (\n) to the parameter value.
fake_post <- fiery::fake_request(
'http://example.com/test',
method = "post",
content = 'id=34632',
headers = list(
Content_Type = 'application/x-www-form-urlencoded'
)
)
post_req <- Request$new(fake_post)
post_req$parse(`application/x-www-form-urlencoded` =
parse_queryform() )
post_req$body
The output is:
Notice that the id value has a trailing newline (\n), which seems wrong.
For a two parameters POST, the newline is appended to only the second parameter, not the first.
This code fragment parses a simulated
POSTrequest with one parameter. It appears that the parser is appending an unwanted newline (\n) to the parameter value.The output is:
Notice that the
idvalue has a trailing newline (\n), which seems wrong.For a two parameters
POST, the newline is appended to only the second parameter, not the first.