Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Unable to connect api using golang

    Go SDK
    0
    3
    15
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      GudHelp last edited by

      Get "https://myexternalip.com/raw": dial tcp 202.164.51.25:443: connectex: No connection could be made because the target machine actively refused it.

      M S 2 Replies Last reply Reply Quote 0
      • M
        Moderator_3 @GudHelp last edited by

        Hello @GudHelp

        Currently we are not supporting for GoLang but we are supporting for java,python and node

        Regards,
        SmartAPI Team

        1 Reply Last reply Reply Quote 0
        • S
          Santoshanand @GudHelp last edited by

          @GudHelp

          You can use this code

          func getPublicIp() (string, error) {
          	resp, err := http.Get("https://myexternalip.com/raw")
          	if err != nil {
          		return "", err
          	}
          	content, _ := ioutil.ReadAll(resp.Body)
          	err = resp.Body.Close()
          	if err != nil {
          		return "", err
          	}
          	return string(content), nil
          }
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post