mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-31 02:28:09 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			427 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			427 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package api
 | |
| 
 | |
| import (
 | |
| 	"encoding/json"
 | |
| 	"net/http"
 | |
| )
 | |
| 
 | |
| // Response is a raw response that wraps an HTTP response.
 | |
| type Response struct {
 | |
| 	*http.Response
 | |
| }
 | |
| 
 | |
| // DecodeJSON will decode the response body to a JSON structure. This
 | |
| // will consume the response body, but will not close it. Close must
 | |
| // still be called.
 | |
| func (r *Response) DecodeJSON(out interface{}) error {
 | |
| 	dec := json.NewDecoder(r.Body)
 | |
| 	return dec.Decode(out)
 | |
| }
 | 
