Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API does not use divstyles when using GET/POST method #6

Open
appblue opened this issue Aug 29, 2014 · 1 comment
Open

API does not use divstyles when using GET/POST method #6

appblue opened this issue Aug 29, 2014 · 1 comment

Comments

@appblue
Copy link

appblue commented Aug 29, 2014

I've looked at the code and in my opinion the problem lies in main.py in line no 85:

divstyles = request.form.get('divstyles', get_default_style())

it should be

divstyles = request.values.get('divstyles', get_default_style())

On webpage it works, because you use also value for divstyles stored in cookie, but it's not the case when using API

Best Regards,
Chris

@NuclearManD
Copy link

I am experiencing the same issue. Bump.

Workaround (Python3 requests):

import requests

r = requests.post('http://hilite.me/api', data={'code':'echo "This is basically just a form', 'lexer':'bash', 'divstyles':'padding:.2em .6em;'})

print(r.content.decode())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants