我在开发环境中使用npmjs的bitly包进行bitly测试,当我运行bitly.shorten(link)
时,我得到以下错误信息:
{
"message": "INVALID_ARG_LONG_URL",
"resource": "bitlinks",
"description": "The value provided is invalid.",
"errors": [
{
"field": "long_url",
"error_code": "invalid"
}
]
}
url的缩写是http://localhost:3000/file/cto/pdf/en/2020-11-19/Presentation-Customer-AREVA-Hydrolic.pdf
是否禁止localhost
链接的转换?
我尝试添加https
而不是http
,但这不起作用,我查看了他们的文档,没有看到任何限制。
我认为bitly是为缩短长url而设计的。
这是预期会失败,还是会因为URL太长而在生产环境中失败?
发布于 2021-02-12 15:33:38
使用http://127.0.0.1
而不是localhost
。这对我很管用。
https://stackoverflow.com/questions/64920574
复制相似问题