hurl icon indicating copy to clipboard operation
hurl copied to clipboard

Support ip query for getting resolved response IP

Open jcamiel opened this issue 1 year ago • 0 comments

A proposal to add an ip query

GET https://foo.com
HTTP 200
[Asserts]
ip == "192.168.0.1"
GET https://foo.com
HTTP 200
[Asserts]
ip matches /2001:0000:130F:0000:0000:09C0:876A:\d*/

In libcurl the corresponding call is CURLINFO_PRIMARY_IP.

There is also a CURLINFO_LOCAL_IP but I've the impression that user expectation is more on primary ip.

Question: what's about port ? Does the query ip exctract the IP address and the port (192.168.0.01:8080), or do we have a separate port query that we can do latter?

GET https://foo.com
HTTP 200
[Asserts]
ip == "192.168.0.1"
port == 8080

With ip/portas separated queries, we can also have isIPv6 and isIPv4 predicates:

GET https://foo.com
HTTP 200
[Asserts]
ip isIPv6

Idea from @lepapareil 😎

jcamiel avatar Aug 01 '24 07:08 jcamiel