需求字符串拼接翻译:
传递给百度翻译api的数据: &source=卡车之家&keyword=陕汽德龙&title=谁会是自己的继任者?普京回应&desc=其定位就是中国重卡走向世界一流的里程碑式作品。&createUser=武二&4@=当地时间6月30日,俄罗斯总统普京在与民众进行的直播连线中谈及继任者问题。他表示,他的责任是给总统候选人提供建议。希望当时机成熟时,他能说出谁有资格领导国家。当地时间6月30日,俄罗斯总统普京在与民众进行的直播连线中谈及继任者问题。他表示,他的责任是给总统候选人提供建议。希望当时机成熟时,他能说出谁有资格领导国家。当地时间6月30日,俄罗斯总统普京在与民众进行的直播连线中谈及继任者问题。他表示,他的责任是给总统候选人提供建议。希望当时机成熟时,他能说出谁有资格领导国家。
返回接收的数据:&Source = truck home & keyword = Shaanxi Automobile Delong & title = who will be his successor? Putin's response & desc = its positioning is a milestone work for China's heavy truck to become world-class& On June 30 local time, Russian President Vladimir Putin talked about his successor in a live line with the public. He said his responsibility is to advise presidential candidates. I hope that when the time is ripe, he can say who is qualified to lead the country. On June 30 local time, Russian President Vladimir Putin talked about his successor in a live line with the public. He said his responsibility is to advise presidential candidates. I hope that when the time is ripe, he can say who is qualified to lead the country. On June 30 local time, Russian President Vladimir Putin talked about his successor in a live line with the public. He said his responsibility is to advise presidential candidates. I hope that when the time is ripe, he can say who is qualified to lead the country.
现在的问题是:"&createUser=武二&4@=" 这一块返回的有问题 导致内容获取不到. 求大佬指教
武二&4@=
这个就很异常,你给所有的value
都做一下encode
。本质来讲,查询字符串部分是
?key=value&key1=value1
,&
符号是关键词,所以如果你的 value 包含了一些关键词需要encode