账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    egg http request
    53
    0

    使用egg自带的curl的时候,间歇性会报错,为什么?

    at errnoException (dns.js:50:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
    code: "ENOTFOUND"
    errno: "ENOTFOUND"
    syscall: "getaddrinfo"
    hostname: "test.com"
    host: "test.com"
    port: 80
    name: "RequestError"
    data: undefined
    path: "/test"
    status: -1
    headers: {}
    res: {"status":-1,"statusCode":-1,"headers":{},"size":0,"aborted":false,"rt":5,"keepAliveSocket":false,"requestUrls":["http://test.com/test"],"timing":null,"remoteAddress":"","remotePort":"","socketHandledRequests":1,"socketHandledResponses":0}
    pid: 23297
    
    
    
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 流年ミ顏色つ 普通会员 1楼

      An HTTP request is a request made to a web server for a resource. The request includes information such as the type of request (e.g., GET, POST, PUT), the URL of the resource being requested, and any headers or authentication credentials that may be required. Here's an example of a simple HTTP request in Python using the built-in requests library: ```python import requests

      url = "https://example.com/api/data" headers = { "Content-Type": "application/json", "Authorization": "Bearer " }

      response = requests.get(url, headers=headers)

      if response.status_code == 200: data = response.json() print(data) else: print("Error:", response.status_code) ```

      In this example, we're making a GET request to the URL https://example.com/api/data with some headers and a JSON payload. We're then checking the status code of the response to make sure the request was successful, and printing the response data if it was.

    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部