mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vweb: set request data with body text to allow use in actions
This commit is contained in:
parent
c2e453fbb9
commit
93920a4bb0
@ -235,6 +235,7 @@ fn handle_conn<T>(conn net.Socket, app mut T) {
|
|||||||
}
|
}
|
||||||
req := http.Request{
|
req := http.Request{
|
||||||
headers: http.parse_headers(headers) //s.split_into_lines())
|
headers: http.parse_headers(headers) //s.split_into_lines())
|
||||||
|
data: strip(body)
|
||||||
ws_func: 0
|
ws_func: 0
|
||||||
user_ptr: 0
|
user_ptr: 0
|
||||||
method: vals[0]
|
method: vals[0]
|
||||||
@ -243,6 +244,7 @@ fn handle_conn<T>(conn net.Socket, app mut T) {
|
|||||||
$if debug {
|
$if debug {
|
||||||
println('req.headers = ')
|
println('req.headers = ')
|
||||||
println(req.headers)
|
println(req.headers)
|
||||||
|
println('req.data="$req.data"' )
|
||||||
println('vweb action = "$action"')
|
println('vweb action = "$action"')
|
||||||
}
|
}
|
||||||
//mut app := T{
|
//mut app := T{
|
||||||
@ -255,9 +257,7 @@ fn handle_conn<T>(conn net.Socket, app mut T) {
|
|||||||
}
|
}
|
||||||
//}
|
//}
|
||||||
if req.method in methods_with_form {
|
if req.method in methods_with_form {
|
||||||
body = strip(body)
|
app.vweb.parse_form(req.data)
|
||||||
println('body="$body"' )
|
|
||||||
app.vweb.parse_form(body)
|
|
||||||
}
|
}
|
||||||
if vals.len < 2 {
|
if vals.len < 2 {
|
||||||
$if debug {
|
$if debug {
|
||||||
|
Loading…
Reference in New Issue
Block a user