GET Request Like Mozilla Firefox [JavaScript/AJAX Code]

To send a GET request like Mozilla Firefox, you need to use a custom User-Agent header that emulates a request from Mozilla Firefox. The Server analyzes User-Agent headers to determine the browser type even when they do not know the exact source of the request. The User-Agen header is slightly different in different versions of Mozilla Firefox. Mozilla Firefox also sends several other headers, like Accept, Accept-Encoding, which indicate that the client can accept data in the specified encoding. In this GET Request Like Mozilla Firefox example, we send a GET request to the ReBin echo URL. Click Send to execute the GET Request Like Mozilla Firefox example online and see the results. The JavaScript/AJAX code was automatically generated for the GET Request Like Mozilla Firefox example.
GET Request Like Mozilla Firefox [JavaScript/AJAX Code] Send
GET /echo HTTP/1.1
Host: reqbin.com
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0
Upgrade-Insecure-Requests: 1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate

Updated: Viewed: 9431 times
JavaScript/AJAX code for GET Request Like Mozilla Firefox example

JavaScript/AJAX code for GET Request Like Mozilla Firefox Example

This JavaScript/AJAX code snippet was generated automatically for the GET Request Like Mozilla Firefox example.
<< Back to the GET Request Like Mozilla Firefox example

What is GET request

The HTTP GET request method requests a resource from the server using the provided URL. The GET method is one of nine standard methods of HTTP (Hypertext Transfer Protocol). A GET request should only be used to retrieve data from a server. The HTTP GET requests cannot contain data in the body of a GET message and cannot change the server's state.

HTTP GET Request Example
GET /echo HTTP/1.1
Host: reqbin.com
Accept: */*

What is User-Agent?

An HTTP User-Agent header contains a string that identifies the operating system and browser used by the web server. Servers and peers use a User-Agent request header to identify a user agent's application, operating system, vendor, and/or version. As each browser uses a different format and contains numerous pieces of information, User-Agent strings can be composed differently. When your browser connects to a website, a User-Agent field is included in HTTP headers. Depending on the browser, the header field contains different data. Different websites are served by web browsers and operating systems based on this information.

How to emulate requests from Mozilla Firefox?

Servers determine the browser name and version using the User-Agent header. In order to send a GET or POST request like Mozilla Firefox, you need to provide an appropriate User-Agent header. For example, the header "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0" indicates that the request is from Mozilla Firefox version 71.

GET Request like Google Mozilla Firefox

The following is an example of a GET request like Mozilla Firefox:

GET Request of Mozilla Firefox Example
GET /echo HTTP/1.1
Host: reqbin.com
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0
Upgrade-Insecure-Requests: 1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate

Server response to our GET request:

Server Response Example
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Connection: keep-alive
...
Content-Encoding: gzip

See also

Generate code snippets for JavaScript/AJAX and other programming languages

Convert your GET Request Like Mozilla Firefox request to the PHP, JavaScript/AJAX, Curl/Bash, Python, Java, C#/.NET code snippets using the JavaScript/AJAX code generator.