Echo: Bind does not work when request was made with single quotes

Created on 2 Jun 2016  路  2Comments  路  Source: labstack/echo

I'm making a request in python to an API i have in go using echo. I found out that python is sending the request with single quotes and i get the following error when trying to bind the request.

Request {'amount': 23, 'reference': '8000000', 'source': 'Subir Semanal'}
Error: [invalid character 'a' looking for beginning of value]

When i change the request to use double quotes it fixes it.

Is there a way to also admit single quotes as a valid string delimeter?

question

Most helpful comment

As far I know, single quotes in a JSON is not valid. Probably you need to convert dict to json before sending.

json.dumps({'amount': 23, 'reference': '8000000', 'source': 'Subir Semanal'})

All 2 comments

As far I know, single quotes in a JSON is not valid. Probably you need to convert dict to json before sending.

json.dumps({'amount': 23, 'reference': '8000000', 'source': 'Subir Semanal'})

thanks for the help!! :D it works now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexzorin picture alexzorin  路  3Comments

toorop picture toorop  路  4Comments

montanaflynn picture montanaflynn  路  3Comments

spielstein picture spielstein  路  3Comments

wangxianzhuo picture wangxianzhuo  路  4Comments