Skip to content

Commit

Permalink
Add a body writing to the web test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
themue committed Dec 3, 2021
1 parent c7c876c commit 15113ed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions environments/web.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ func (wreq *WebRequest) SetAccept(contentType string) {
wreq.Header().Set(HeaderAccept, contentType)
}

// Write implements the io.Writer interface.
func (wreq *WebRequest) Write(body []byte) (int, error) {
wreq.body = append(wreq.body, body...)
return len(wreq.body), nil
}

// Upload sets the request as a file upload request.
func (wreq *WebRequest) Upload(fieldname, filename, data string) {
wreq.fieldname = fieldname
Expand Down

0 comments on commit 15113ed

Please sign in to comment.