Configuring the HTTP template

A feature that uses the HTTP template performs the HTTP operation to measure the time it takes the NQA client to obtain data from an HTTP server.

The expected data is checked only when the data is configured and the HTTP response contains the Content-Length field in the HTTP header.

The status code of the HTTP packet is a three-digit field in decimal notation, and it includes the status information for the HTTP server. The first digit defines the class of response.

Configure the HTTP server before you perform the HTTP operation.

To configure the HTTP template:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Create an HTTP template and enter its view.

nqa template http name

By default, no HTTP templates exist.

3. Specify the URL of the destination HTTP server.

url url

By default, no URL is specified for the destination HTTP server.

Enter the URL in one of the following formats:

  • http://host/resource.

  • http://host:port/resource.

4. Specify an HTTP login username.

username username

By default, no HTTP login username is specified.

5. Specify an HTTP login password.

password { cipher | simple } string

By default, no HTTP login password is specified.

6. (Optional.) Specify the HTTP version.

version { v1.0 | v1.1 }

By default, HTTP 1.0 is used.

7. (Optional.) Specify the HTTP operation type.

operation { get | post | raw }

By default, the HTTP operation type is get, which means obtaining data from the HTTP server.

If you set the HTTP operation type to raw, use the raw-request command to specify the content of the HTTP request to be sent to the HTTP server.

8. (Optional.) Enter raw request view.

raw-request

This step is required for the raw operation.

Every time you enter the raw request view, the existing request content configuration is removed.

9. (Optional.) Enter or paste the content of the HTTP request for the HTTP operation.

N/A

This step is required for the raw operation.

By default, the HTTP request content is not specified.

10. (Optional.) Return to HTTP template view.

quit

The system automatically saves the configuration in raw request view before it returns to HTTP template view.

11. (Optional.) Specify the source IP address for the probe packets.

  • IPv4 address:
    source ip
    ip-address

  • IPv6 address:
    source ipv6
    ipv6-address

By default, the packets take the primary IP address of the output interface as their source IP address.

The source IP address must be the IP address of a local interface, and the interface must be up. Otherwise, no probe packets can be sent out.

12. (Optional.) Configure the expected status codes.

expect status status-list

By default, no expected status code is configured.

13. (Optional.) Configure the expected data.

expect data expression [ offset number ]

By default, no expected data is configured.