Hello Team,
My workspace has a transformer HTTPCaller that send request to googlemaps API without problem, its works!
I want to demonstrate my customer that is possible to build this URL and send request to googlemaps using python ( PythonCaller ).
import fme
import fmeobjects
import json,urllib
from urllib import urlencode
import googlemaps
import re
REMOVE_HTML_TAGS= r'<[^>]+>'
def _googlemaps_(feature):
url = 'https://maps.googleapis.com/maps/api/directions/json?%s' % urlencode((
('origin',feature.getAttribute('inicio')),
('destination',feature.getAttribute('destino')),('waypoints=optimize:true|',feature.getAttribute('waypoints'))
))
resultado = json.load(urllib.urlopen(url))
print url
When i run my Workspace the URL result has special caracters and doenst works my request:
How can i configurated in python to dont generate these special caracteres?
Thanks in Advance,
Danilo