Last updated 9 months ago
POST https://api.oxylabs.io/v1/whitelisted_ips
curl -X POST -u username:password "https://api.oxylabs.io/v1/whitelisted_ips" --header "Content-Type: application/json" --data '{"address": "127.0.0.1"}'
<?php $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, "https://api.oxylabs.io/v1/whitelisted_ips"); $payload = json_encode( array( "address"=> "127.0.0.1" ) ); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $payload); curl_setopt( $curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_USERPWD, 'username:password'); $result = curl_exec($curl); ?>
import requests requests.post('https://api.oxylabs.io/v1/whitelisted_ips', json={"address": "127.0.0.1"}, auth=('username', 'password'))
{ "error": { "message": "This is not a valid IP address.", "code": 422 } }
{ "id": 9767, "address": "127.0.0.1" }
201
成功。IP 地址已添加到列表中。响应正文包含新添加的 地址 和 id。
地址
id
422
错误。请求体包含无效的 IP 地址。请求体包含错误消息。