Skip to content

Instantly share code, notes, and snippets.

@JIntrocaso
Created September 24, 2020 23:45
Show Gist options
  • Save JIntrocaso/bd058fffd8c997bcce37e1439490439e to your computer and use it in GitHub Desktop.
Save JIntrocaso/bd058fffd8c997bcce37e1439490439e to your computer and use it in GitHub Desktop.
IPIFY API Call
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