UnityTools.IO.UnityAgent.Head C# (CSharp) Method

Head() public method

The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response.
public Head ( string url ) : UnityAgentRequest
url string The request URL.
return UnityAgentRequest
        public UnityAgentRequest Head(string url)
        {
            return CreateRequest("HEAD", url);
        }

Usage Example

示例#1
0
        public void TestApiHeadSyncronous()
        {
            UnityAgent agent = new UnityAgent();
            string url = GetTestUrl("get");

            var response = agent
                .Head(url)
                .Begin()
                .Result;

            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
            Assert.That(response.Body.Length == 0);
        }