File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
package client
2
2
3
3
import (
4
- "encoding/json"
5
4
"log"
6
5
"strings"
7
6
7
+ jsoniter "github.com/json-iterator/go"
8
8
"github.com/valyala/fasthttp"
9
9
)
10
10
@@ -66,7 +66,7 @@ func (http *Client) Body(raw string) *Client {
66
66
67
67
// BodyJSON sets the request body by converting the object to JSON.
68
68
func (http * Client ) BodyJSON (obj interface {}) * Client {
69
- data , err := json .Marshal (obj )
69
+ data , err := jsoniter .Marshal (obj )
70
70
71
71
if err != nil {
72
72
log .Printf ("Error converting request body to JSON: %v" , err )
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ package client
2
2
3
3
import (
4
4
"bytes"
5
- "encoding/json"
6
5
6
+ jsoniter "github.com/json-iterator/go"
7
7
"github.com/valyala/fasthttp"
8
8
)
9
9
@@ -53,5 +53,5 @@ func (response Response) RawBytes() []byte {
53
53
54
54
// Unmarshal tries to JSON decode the response and save it in the object.
55
55
func (response Response ) Unmarshal (obj interface {}) error {
56
- return json .Unmarshal (response .Bytes (), obj )
56
+ return jsoniter .Unmarshal (response .Bytes (), obj )
57
57
}
You can’t perform that action at this time.
0 commit comments