1. Questions
The node server requests the java interface with the following code. The local host name in the project is localhost, so it will not report an error, but it will report an error after it is deployed to the formal environment error:getaddrinfo ENOTFOUND www.xxxx.com www.xxxx.com :8080
var opt = {
hostname: 'http://www.xxxx.com',
port: '8080',
method: 'POST',
path: path,
headers: {
"Content-Type": 'application/json;charset=utf-8',
}
}
2. Solution
Because the host name only fills in the actual host name, remove the http:// or HTTPS:// in the host name (fill in the specific path in the path), and you can request normally.
Read More:
- [Solved] Swagger request error: error:getaddrinfo ENOTFOUND
- [Solved] Error: caused by: java.net.bindexception: the address is already in use
- [Solved] JAVA connect HBase program is stuck and does not report an error
- The Java class generated by protocol reports an error: cannot access
- Xdoc generates API documents based on Java annotations
- Weibo API api Called Error: error:appkey not bind domain! error_code:10017/2/statuses/share.json
- [Solved] nacos Error: com.alibaba.nacos.api.exception.NacosException: failed to req API:/nacos/v1/ns/instance
- Spring MVC uses Ajax to submit requests asynchronously to complete login
- Java uses class array to report error Exception in thread “main” java.lang.NullPointerException solution
- Caused by: java.lang.IllegalStateException (How to Fix)
- jemter java.net.BindException:Address alreardy in use [How to Solve]
- API Failed to Connect phoenix Error: java.sql.SQLException: ERROR 726 (43M10): Inconsistent namespace mapping properties
- Asynchronous processing of HTTP request by Java_ Method 1: through callable
- [Solved] Solr8 establishes the cluster node as active, but the query reports an error
- [Solved] Kafka in Windows error:java. nio. file. Filesystemexception: this file is in use by another program and cannot be accessed by the process
- [Solved] ClientAbortException: java.io.IOException: Connection reset by peer
- Java: How to Find the Minimum Value from a Random Array by Bubble Sort Method
- [Solved] Error installing MVN: Java_Home is set to an invalid directory
- Asynchronous processing of HTTP request by Java_ Method 2: through deferredresult
- How to Fix Error Caused by: java.util.MissingResourceException: Can‘t find bundle for base name xxx, locale zh_CN