When you request in the Chrome browser (for example, search for the city of Graz in Austria) maps.googleapis.com/maps/api/geocode/xml?address=Graze%20Austria&language=ru returns the XML file in Russian names.

When requesting from 1C, the exact same address maps.googleapis.com/maps/api/geocode/xml?address=Grac%20Austria&language=ru but returns the XML file to non-Russian names. Grazstraße, Premstätten, etc.

Why?

  • And how exactly do you form a request from 1C? What version of the platform are we talking about? - Mikhail Sibirev
  • Look through Fiddler all the headers sent by the browser and insert them into your request - Serginio

1 answer 1

I give the working code

Адрес = "maps.googleapis.com"; Соединение = Новый HTTPСоединение(Адрес); ПолучениеЗапрос = "maps/api/geocode/xml?address=%D0%93%D1%80%D0%B0%D1%86%20%D0%90%D0%B2%D1%81%D1%82%D1%80%D0%B8%D1%8F&language=ru"; Запрос = Новый HTTPЗапрос(ПолучениеЗапрос); Ответ = Соединение.Получить(Запрос); ЧтениеХМЛ = Новый ЧтениеXML; ЧтениеХМЛ.УстановитьСтроку(Ответ.ПолучитьТелоКакСтроку()); ТвойФайл = ФабрикаXDTO.ПрочитатьXML(ЧтениеХМЛ); 

Screenshot of the result