Код: Выделить всё
headers = {
'Content-Type': 'application/json',
'OTPTimeout': '180000',
}
data2 = '{"query" :"query {trip(from: {coordinates: {latitude: 27.94942 longitude: -82.47202 }}to:\
{coordinates: {latitude: 27.99107 longitude: -82.45619 }} dateTime: "2024-11-18T14:00:00.000Z") \
{tripPatterns {duration distance legs{ distance duration id mode}}}}"}'
response = requests.post('http://localhost:8080/otp/transmodel/v3', headers = headers, data = data2)
json_string = response.text
Код: Выделить всё
Unexpected character ('2' (code 50)): was expecting comma to separate Object entries
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 167]
Подробнее здесь: https://stackoverflow.com/questions/791 ... python-ope