Reputation: 136
I have a routine that currently uses
httpgettext to send two urls out to google..
The first with the maps key and the second to get some distance calculations with is returned as a JSON object...
It all worked fine but now the client wants it to go through a proxy server.
I have tried modifying code that was on synapse knowledge base but i just get a bad response...
The code looks like this that works no proxy...
buildstring:='http://maps.google.com/maps?file=api&v2&key=ASASASASASASASAS-AAAA';
httpgettext(buildstring,myoutput);
buildstring:='http://maps.googleapis.com/maps/api/directions/json?origin='+trim(start_postcode)+'&destination='+trim(end_postcode)+'&sensor=false';
httpgettext(buildstring,myoutput);
How do I get the same response but through a proxy?
The google maps key above is fake - and will not work - you need to use your own.
When I tried modifying an example the first request came back OK the second one came back with a 400 bad request.
With thanks in advance Phil Hutchinson
Upvotes: 0
Views: 1207
Reputation: 136
I have found the issue? I looked at the source code demos supplied and if I create a type of httpsend and put the proxy info in and send the request, the first one works.
The second request fails - so it must be something to do with the htppsend method leaving some rubbish in the type. If I destroy it and send it again it works fine.
Not the perfect solution but it works!
Upvotes: 1