> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/products/cn/dai-li/mobile-proxies/making-requests.md).

# 发起请求

## 基本查询

基本查询只需要传入 `用户名` 和 `密码`。不需要其他参数。这样的查询会导致请求从随机 IP 地址（代理）发出。每个新请求都会使用不同的代理。

#### 代码示例

在此示例中，对 `ip.oxylabs.io` 从随机 IP 执行：

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

```shell
curl -x pr.oxylabs.io:7777 -U "customer-USERNAME:PASSWORD" https://ip.oxylabs.io/location
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$username = 'USERNAME';
$password = 'PASSWORD';
$proxy = 'pr.oxylabs.io:7777';
$query = curl_init('https://ip.oxylabs.io/location');
curl_setopt($query, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($query, CURLOPT_PROXY, "http://$proxy");
curl_setopt($query, CURLOPT_PROXYUSERPWD, "customer-$username:$password");
$output = curl_exec($query);
curl_close($query);
if ($output)
    echo $output;
?>
```

{% endtab %}

{% tab title="Python" %}

```python
import urllib.request
import random
username = 'USERNAME'
password = 'PASSWORD'
entry = ('http://customer-%s:%s@pr.oxylabs.io:7777' %
    (username, password))
query = urllib.request.ProxyHandler({
    'http': entry,
    'https': entry,
})
execute = urllib.request.build_opener(query)
print(execute.open('https://ip.oxylabs.io/location').read())
```

{% endtab %}

{% tab title="Java" %}

```java
package example;

import org.apache.http.HttpHost;
import org.apache.http.client.fluent.*;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpHost entry = new HttpHost("pr.oxylabs.io", 7777);
        String query = Executor.newInstance()
            .auth(entry, "customer-USERNAME", "PASS")
            .execute(Request.Get("http://ip.oxylabs.io/location").viaProxy(entry))
            .returnContent().asString();
        System.out.println(query);
    }
}
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Net;

class Example
{
    static void Main()
    {
        var client = new WebClient();
        client.Proxy = new WebProxy("pr.oxylabs.io:7777");
        client.Proxy.Credentials = new NetworkCredential("customer-USERNAME", "PASSWORD");
        Console.WriteLine(client.DownloadString("https://ip.oxylabs.io/location"));
    }
c
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'uri'
require 'net/http'

uri = URI.parse('https://ip.oxylabs.io/location')
proxy = Net::HTTP::Proxy('pr.oxylabs.io', 7777, 'customer-USERNAME', 'PASSWORD')

req = Net::HTTP::Get.new(uri.path)

result = proxy.start(uri.host,uri.port) do |http|
    http.request(req)
end

puts result.body
```

{% endtab %}
{% endtabs %}

单个 backconnect 代理允许你通过用户名中的附加参数选择特定国家的代理。此方法也支持会话控制。下面是凭据结构示例：

`customer-USERNAME-cc-US-sessid-abcde12345:PASSWORD`

#### 查询参数

| 参数                                                        | 说明                                                                                                                                                                                                                                                                         |
| --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="background-color:green;">**customer**</mark> | 用户名                                                                                                                                                                                                                                                                        |
| `cc`                                                      | 不区分大小写的两字母国家代码 [**3166-1 alpha-2 格式**](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). 例如， `DE` 表示德国， `GB` 表示英国， `TH` 表示泰国。有关如何使用特定国家/地区代理的更多详情，请参阅 [**此处**](/products/cn/dai-li/mobile-proxies/location-settings/country.md#country-specific-entry-nodes).             |
| `city`                                                    | 不区分大小写的英文城市名称。为提高准确性，此参数必须与 `cc` 一起使用，例如， `cc-GB-city-london` 表示英国伦敦； `cc-DE-city-berlin` 表示德国柏林。对于包含两个以上单词的城市，请将空格替换为 `_`，例如， `city-st_petersburg` 或 `city-rio_de_janeiro`. 点击 [**此处**](/products/cn/dai-li/mobile-proxies/location-settings/select-city.md) 了解更多城市级定向信息。 |
| `st`                                                      | 不区分大小写的美国州名，前缀为 us\_，例如， `us_california`, `us_illinois`. [**点击此处**](/products/cn/dai-li/mobile-proxies/location-settings/select-state.md) 了解更多州级定向信息。                                                                                                                      |
| `sessid`                                                  | 会话 ID，用于在后续查询中保持相同 IP。会话在 10 分钟后过期。之后，该会话 ID 会分配新的 IP 地址。支持随机字符串、0-9 和 A-Z 字符。                                                                                                                                                                                             |
| `sesstime`                                                | 会话时长参数可在指定时间内保持相同 IP。最长会话时长为 30 分钟。                                                                                                                                                                                                                                        |
| <mark style="background-color:green;">**密码**</mark>       | 密码                                                                                                                                                                                                                                                                         |

&#x20;     \- 必填参数


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.oxylabs.io/products/cn/dai-li/mobile-proxies/making-requests.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
