-2

我正在使用一种格式的 URL。但是当我在谷歌中输入它并按下输入时它正在转换为另一种格式。

以下是我的原始网址

'https://translation.googleapis.com/language/translate/v2?q=hai basha.how are  you&target=te&key={YOUR_API_KEY}'

下面是我的编码网址

'https://translation.googleapis.com/language/translate/v2?q=hai%20basha.how%20are%20you&target=te&key={YOUR_API_KEY}'

我怎样才能在我的代码中实现这一点。其实是一种GET方法。

4

1 回答 1

-1

您可以使用 String.replace 方法将字符更改为各自的特殊字符表示法。并通过 get 或 post 或您想要的任何方式拨打电话。

于 2018-02-22T09:27:20.207 回答