github.com/adirkuhn/go-woocommerce-api v1.0.9
Copy data via io.CopyCreates a new HTTP request
SHA-2565accb5111b13fa383faf8c8e8a11487db5f86ad793fc61008eaf5a882852ad77
MaleculeH₂(Cm₃F)
Evidence
3import (
4 "bytes"
5 "context"
6 "encoding/base64"
7 "encoding/json"
8 "errors"
9 "fmt"
10 "io"
11 "net/http"
12 "net/url"
13 "strings"
14 "time"
145 req, err := http.NewRequestWithContext(ctx, method, u.String(), buf)
146 if err != nil {
147 return nil, err
148 }
150 req.Header.Set(defaultHeaderName, c.authHeader)
151 req.Header.Set("Accept", acceptedContentType)
152 req.Header.Set("Content-Type", acceptedContentType)
153 req.Header.Set("User-Agent", userAgent)
199 if v != nil {
200 switch w := v.(type) {
201 case io.Writer:
202 _, _ = io.Copy(w, resp.Body)
203 default:
204 if err := json.NewDecoder(resp.Body).Decode(v); err != nil && err != io.EOF {
205 return resp, false, err
5Permission is hereby granted, free of charge, to any person obtaining a copy
6of this software and associated documentation files (the "Software"), to deal
7in the Software without restriction, including without limitation the rights
No evidence locations were recorded for this file. Raw result