Skip to content

Conversation

@elysia-best
Copy link
Contributor

更新 IP 检测逻辑,改用 XML 格式而非 JSON 来获取国家代码。

参见:renfei/feedback#3 ,该 API 现仅支持 XML 格式。

示例返回如下

$ curl -s "http://ip.renfei.net" -H "Accept: application/xml"
<?xml version="1.0" encoding="UTF-8"?>
<ip>
    <clientIP>1.1.1.1</clientIP>
    <location>
        <countryCode>CN</countryCode>
        <countryName>China</countryName>
        <region>Beijing</region>
        <city>Beijing</city>
        <asn>9808</asn>
        <line>China Mobile Communications Group Co. Ltd.</line>
        <latitude>3.2</latitude>
        <longitude>1.1</longitude>
    </location>
    <readme>https://github.com/renfei/feedback/discussions/3</readme>
</ip>

Updated IP detection to use XML instead of JSON for country code retrieval.

See renfei/feedback#3, the api now only support xml format.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant