# Making Requests

Make a request to `https://ip.oxylabs.io/location` using the first Dedicated Datacenter proxy in your list. Replace `USERNAME` and `PASSWORD` with your proxy user credentials.&#x20;

{% hint style="info" %}
Use [**ip.oxylabs.io/location**](https://ip.oxylabs.io/location) to check the parameters of your IPs—this domain delivers information from four geolocation databases: MaxMind, IP2Location, DB-IP, and IPinfo.io. The parameters include IP address, provider, country, city, ZIP code, ASN, organization name, time zone, and meta (when disclosed by database).
{% endhint %}

```sh
curl -x ddc.oxylabs.io:8001 -U "user-USERNAME:PASSWORD" https://ip.oxylabs.io/location 
```

Please note that you must follow the above example of building the username string to make requests successfully. Append the `user-` string to your username and be aware that credentials are case-sensitive.

**Code examples**

{% tabs %}
{% tab title="cURL" %}

```sh
curl -x ddc.oxylabs.io:8001 -U "user-USERNAME:PASSWORD" https://ip.oxylabs.io/location 
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

username = 'USERNAME'
password = 'PASSWORD'
proxy = 'ddc.oxylabs.io:8001'

proxies = {
   "https": ('https://user-%s:%s@%s' % (username, password, proxy))
}

response=requests.get("https://ip.oxylabs.io/location", proxies=proxies)

print(response.content)
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const axios = require("axios");
const https = require("https");

const client = axios.create({
    httpsAgent: new https.Agent({
        rejectUnauthorized: false,
    }),
});
const username = 'USERNAME';
const password = 'PASSWORD'

client
    .get("https://ip.oxylabs.io/location", {
        proxy: {
            protocol: "https",
            host: "ddc.oxylabs.io",
            port: 8001,
            auth: {
                username: `user-${username}`,
                password: password,
            },
        },
    })
    .then((res) => {
        console.log(res.data);
    })
    .catch((err) => console.error(err));

```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$username = 'USERNAME';
$password = 'PASSWORD';
$proxy = 'https://ddc.oxylabs.io:8001';
$target = 'https://ip.oxylabs.io/location';

$request = curl_init($target);
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($request, CURLOPT_PROXY, $proxy);
curl_setopt($request, CURLOPT_PROXYUSERPWD, "user-$username:$password");
$responseBody = curl_exec($request);
$error = curl_error($request);
curl_close($request);

if ($responseBody !== false) {
    echo 'Response: ' . $responseBody;
} else {
    echo 'Failed to connect to proxy: ' . $error;
}
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	username, password, entry := "USERNAME", "PASSWORD", "ddc.oxylabs.io:8001"
	proxy, err := url.Parse(fmt.Sprintf("https://user-%s:%s@%s", username, password, entry))
	if err != nil {
		panic(err)
	}

	transport := &http.Transport{
		Proxy: http.ProxyURL(proxy),
	}
	client := &http.Client{Transport: transport}
	target := "https://ip.oxylabs.io/location"
	response, err := client.Get(target)
	if err != nil {
		panic(err)
	}
	defer response.Body.Close()

	body, err := io.ReadAll(response.Body)
	if err != nil {
		panic(err)
	}

	fmt.Println("Response:")
	fmt.Println(string(body))
}
```

{% endtab %}

{% tab title="Java" %}

```java
package com.example;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Base64;

import org.apache.hc.client5.http.fluent.Request;
import org.apache.hc.core5.http.HttpHost;

public class App {
    public static void main(String[] args) throws IOException, URISyntaxException {
        String target = "http://ip.oxylabs.io/location";
        String username = "USERNAME";
        String password = "PASSWORD";
        String proxy = "ddc.oxylabs.io:8001";

        URI proxyURI = new URI(String.format("https://user-%s:%s@%s", username, password, proxy));

        String basicAuth = new String(
                Base64.getEncoder()
                        .encode(
                                proxyURI.getUserInfo().getBytes()));
        String response = Request.get(target)
                .addHeader("Proxy-Authorization", "Basic " + basicAuth)
                .viaProxy(HttpHost.create(proxyURI))
                .execute().returnContent().asString();

        System.out.println(response);
    }
}

```

{% endtab %}

{% tab title="C#" %}

```csharp
using System.Net;

// .NET currently does not support HTTPS proxies
var proxy = new WebProxy {
    Address = new Uri("http://ddc.oxylabs.io:8001"),
    Credentials = new NetworkCredential(
        userName: "user-USERNAME",
        password: "PASSWORD"
    )
};

var httpClientHandler = new HttpClientHandler {Proxy = proxy};

using var client = new HttpClient(handler: httpClientHandler, disposeHandler: true);

var result = await client.GetStringAsync("https://ip.oxylabs.io/location");
Console.WriteLine(result);
```

{% endtab %}
{% endtabs %}

The first IP in your proxy list will always use the`8001` port. To make a request using a different proxy, you will need to find your [**proxy list**](https://developers.oxylabs.io/proxies/dedicated-datacenter-proxies/self-service/proxy-list) and take port values from there.&#x20;
