Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

21 lignes
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. }