Searching for a way to edit client information given

Hi all,

I am currently using a code from ESP32 Web Server - Arduino IDE | Random Nerd Tutorials
and a particular code part got me interested.

WiFiClient client = server.available();   // Listen for incoming clients

  if (client) {                             // If a new client connects,
    Serial.println("New Client.");          // print a message out in the serial port
    String currentLine = "";                // make a String to hold incoming data from the client
    while (client.connected()) {            // loop while the client's connected
      if (client.available()) {             // if there's bytes to read from the client,
        char c = client.read();             // read a byte, then
        Serial.write(c);                    // print it out the serial monitor

The client.read() and write got me interested.
So the information I got from the write/read was the HOST and etc. What I was curious about was the User Agent part of the information read.

So I got my device version and device Serial Number.

My Question is where does this client information come from and is there a way to edit it like getting the device mac address out of it?

Thanks in advance!

What you're reading is the request header/body sent by the client device. To change what it contains, you have to change the client device's code. Its that something you can do in this case?

Can you perhaps define client device code?
If it means the code in the device than I am answering with a no as my device is a phone/laptop using google chrome

The client device is the device sending the request. The code running on that device determines what information is sent with the request. If, as you say, the client device is a phone and the code running on that phone, sending the request, is Chrome browser, then you won't be able to change the contents of the request. However, there is an add-on for Chrome called "RESTman" which will allow you to send requests and control the type of request (GET, POST), the request parameters, request headers and body of the request. This may help you understand what is going on, but it won't change the way Chrome browser tabs send requests.

Alright thanks