           uri: "#{protocol}://httpbin.org/get"
         quest options, (err, resp, body) ->
           assert not err, "Has error #{err}"
-          assert.equal resp.statusCode, 200, "Status code should be 200, is #{resp.statusCode}"
-          assert.equal JSON.parse(body).headers.Host, 'httpbin.org'
+          assert.equal resp?.statusCode, 200, "Status code should be 200, is #{resp?.statusCode}"
+          assert.equal JSON.parse(body)?.headers?.Host, 'httpbin.org'
           done safe_err err
 
       it 'supports interpreting responses as json', (done) ->

          json: true
        quest options, (err, resp, body) ->
          assert not err, "Has error #{err}"
          assert.equal resp.statusCode, 200, "Status code should be 200, is #{resp.statusCode}"
          assert.equal body.url, "http://httpbin.org/get"
          done safe_err err

      it "doesn't follow relative redirects when disabled", (done) ->

          json: true
        quest options, (err, resp, body) ->
          assert not err, "Has error #{err}"
          assert.equal resp?.statusCode, 200, "Status code should be 200, is #{resp?.statusCode}"
          assert.equal body?.headers?.Host, 'httpbin.org'
          done safe_err err

      it 'has a default user-agent', (done) ->
