Created
September 24, 2020 23:45
-
-
Save JIntrocaso/bd058fffd8c997bcce37e1439490439e to your computer and use it in GitHub Desktop.
IPIFY API Call
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public getAPIEndpoint() { | |
this.httpClient.get("https://api.ipify.org?format=json").subscribe(response => { | |
console.log(response); | |
this.ipAddress = response["ip"]; | |
}); | |
} | |
public getGeoEndpoint() { | |
this.httpClient.get("https://geo.ipify.org/api/v1?apiKey=" + this.apiKey).subscribe(response => { | |
console.log(response); | |
this.ipAddress = response["ip"]; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment