View Servers and their Listen Port

You can use a GET request to view the list of servers in a domain, along with their listen port. The following steps show how to build this GET request using cURL:
  1. Identify the host name and port of your domain's Administration Server and construct the GET request using the /management/weblogic/{version}/domainConfig/servers endpoint. This WebLogic Server request uses the following URL structure:
    
                http://localhost:port/management/weblogic/{version}/domainConfig/servers
  2. Specify the headers on the cURL command line:
    • -H X-Requested-By:MyClient

    • -H Accept:application/json

    • -H Content-Type:application/json

  3. Construct the GET request and specify the fields for the name of the server and listen port:

    
                curl -v \ --user admin:admin123 \ -H
                X-Requested-By:MyClient \ -H Accept:application/json \ -X GET
                http://localhost:7001/management/weblogic/latest/domainConfig/servers?fields=name,listenPort&links=no

    The GET request returns the following response:

    HTTP/1.1 200 OK Response Body:
                { "items": [ { "name": "AdminServer", "listenPort": 7001 }, { "name": "ManagedServer1",
                "listenPort": 7003 } ] }