// Start starts the server in the url provided to the NewTestHTTPServer call.
//
// It waits until the server is up.
Start starts the server in the url provided to the NewTestHTTPServer call.

It waits until the server is up.
// Start starts the server in the url provided to the NewTestHTTPServer call . // // It waits until the server is up .
func (s *TestHTTPServer) Start() {
	if s.started {
		return
	}
	s.started = true
	s.Request = make(chan *http.Request, ChanSize)
	s.response = make(chan *testResponse, ChanSize)
	s.body = make(chan []byte, ChanSize)
	url, _ := url.Parse(s.URL)
	go http.ListenAndServe(url.Host, s)
	s.PrepareResponse(202, nil, "Nothing.")
	for {
		resp, err := http.Get(s.URL)
		if err == nil && resp.StatusCode == 202 {
			break
		}
		time.Sleep(1e8)
	}
	s.WaitRequest(1e18)
}
func ( s * TestHTTPServer ) Start ( ) { if s . started { return } s . started = true s . Request = make ( chan * http . Request , ChanSize ) s . response = make ( chan * testResponse , ChanSize ) s . body = make ( chan [ ] byte , ChanSize ) url , _ := url . Parse ( s . URL ) go http . ListenAndServe ( url . Host , s ) s . PrepareResponse ( 202 , nil , " " ) for { resp , err := http . Get ( s . URL ) if err == nil && resp . StatusCode == 202 { break } time . Sleep ( 1e8 ) } s . WaitRequest ( 1e18 ) }
Start starts the server in the url provided to the NewTestHTTPServer call.
Start starts the server in the url provided to the NewTestHTTPServer call .