Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

21 righe
492 B

  1. // Copyright 2017 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package gensupport
  5. import (
  6. "net/http"
  7. "testing"
  8. )
  9. func TestSendRequest(t *testing.T) {
  10. // Setting Accept-Encoding should give an error immediately.
  11. req, _ := http.NewRequest("GET", "url", nil)
  12. req.Header.Set("Accept-Encoding", "")
  13. _, err := SendRequest(nil, nil, req)
  14. if err == nil {
  15. t.Error("got nil, want error")
  16. }
  17. }