ok ho trovato l'errore:
come url iniziale non vanno messe sottodirectory o altro, ma solo l'url principale.codice:import httplib class Service(object): conn = None def __init__(self): self.conn = httplib.HTTPConnection("www.sito.it") def readRes(self): self.conn.request(method = 'GET', url = '/service/file.php', headers = { 'Content-Type': 'application/json' }) res = self.conn.getresponse() print res.status, res.reason if __name__ == "__main__": s = Service() s.readRes()
ciao!

Rispondi quotando