Closed icecloud12 closed 5 months ago
Tagged as beginner for it might be a stupid question
req.parse function with the Accept-Encoding section produces a Version error.
I created a post request using postman and got the stream data using tcplistener->tcpstream, converted them to bytes etc..
let buf = b"POST /index.html HTTP/1.1\r\n"; println!("{:#?}", req.parse(buf)); ... println!("{:#?}", req.parse(buf)); let buf = b"Accept-Encoding: gzip, deflate, br"; println!("{:#?}", req.parse(buf)); //error occurs here ...
using current version 1.9.2 attaching sample input generated by postman sampleInput.txt
I am an absolute beginner so this might not be an issue sorry for taking your time
httparse is stateless, so every call to parse(buf) must be with a buffer that represents an HTTP message. Such as "POST /index.html HTTP/1.1\r\nAccept-Encoding: gzip, deflate, br\r\n\r\n".
parse(buf)
"POST /index.html HTTP/1.1\r\nAccept-Encoding: gzip, deflate, br\r\n\r\n"
Tagged as beginner for it might be a stupid question
req.parse function with the Accept-Encoding section produces a Version error.
I created a post request using postman and got the stream data using tcplistener->tcpstream, converted them to bytes etc..
using current version 1.9.2 attaching sample input generated by postman sampleInput.txt
I am an absolute beginner so this might not be an issue sorry for taking your time