Jason is on the right path about using the http functions, however https would be the prefered option.
Read the pdf doc about it.
https://iabtechlab.com/wp-content/uploads/2017/09/IABOpenRTB_Ads.txt_Public_Spec_V1-0-1.pdf
Read from 3.1 onward…
3.1 ACCESS METHOD
Publishers should post the “/ads.txt” file on their root domain and any subdomains as needed. For the purposes of this document the “root domain” is defined as the “public suffix” plus one string in the name. Crawlers should incorporate Public Suffix list [16] to derive the root domain.
The declarations must be accessible via HTTP and/or HTTPS from the website that the instructions are to be applied to under a standard relative path on the server host: “/ads.txt” and and HTTP request header containing “Content-Type: text/plain”. It may be advisable to additionally use “Content-Type: text/plain; charset=utf-8” to signal UTF8 support.
It is also advisable to prefer HTTPS connections over HTTP when crawling ads.txt files. In any case where data is available at an HTTPS and an HTTP connection for the same URL, the data from HTTPS should be preferred.
For convenience we will refer to this resource as the “/ads.txt” file, though the resource need in fact not originate from a file-system.
If the server response indicates Success (HTTP 2xx Status Code,) the advertising system must read the content, parse it, and utilize the declarations.
If the server response indicates an HTTP/HTTPS redirect (301, 302, 307 status codes), the advertising system should follow the redirect and consume the data as authoritative for the source of the redirect, if and only if the redirect is within scope of the original root domain as defined above. Multiple redirects are valid as long as each redirect location remains within the original root domain. For example an HTTP to HTTPS redirect within the same root domain is valid.
Only a single HTTP redirect to a destination outside the original root domain is allowed to facilitate one-hop delegation of authority to a third party’s web server domain. If the third party location returns a redirect, then the advertising system should treat the response as an error. A future version may address other delegation of authority to a third-party web server. Any other redirect should be interpreted as an error and ignored.
If the server response indicates the resource is restricted (HTTP 401) the advertising system should seek direct contact with the site for authorization keys or clarification.
If the server response indicates the resource does not exist (HTTP Status Code 404), the advertising system can assume no declarations exist and that no advertising system is unauthorized to buy and sell ads on the website. For any other HTTP error encountered for a Ads.txt Specification version 1.0.1 IAB Tech Lab IAB Tech Lab 6 URL which the crawler previously found data, the last successfully retrieved data set should be utilized.
3.2 FILE FORMAT
The data is encoded as a formatted plain text object, described here. The HTTP Content-type should be ‘text/plain’, and all other Content-types should be treated as an error and the content ignored. A complete description of the syntax of this format is given in section 3.4 below.
////// and the rest ///////