lol xml
This commit is contained in:
parent
e33f80e57f
commit
61f1b4461e
@ -2,6 +2,7 @@ package task
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
@ -51,6 +52,12 @@ func (z *HttpRequest[T]) Json() func(r *HttpRequest[T]) *HttpRequest[T] {
|
||||
})
|
||||
}
|
||||
|
||||
func (z *HttpRequest[T]) Xml() func(r *HttpRequest[T]) *HttpRequest[T] {
|
||||
return z.With(func(r io.Reader) Decoder {
|
||||
return xml.NewDecoder(r)
|
||||
})
|
||||
}
|
||||
|
||||
func (_ *HttpRequest[T]) NoErr() func(r *HttpRequest[T]) bool {
|
||||
return func(r *HttpRequest[T]) bool {
|
||||
return r.err == nil
|
||||
|
Loading…
Reference in New Issue
Block a user