Open arjenpdevries opened 6 years ago
Hi @arjenpdevries; You can send JSON to the POST endpoint; So, if you have this JSON:
{
"textarea": "Heya! Have you read the docs already?"
}
You could send it to a endpoint like that:
@hug.post('/api/card')
@hug.local()
def birthday_card(textarea:hug.types.text):
"""Receive birthday card"""
return {'message': textarea}
I want to POST a textarea value to a hug-based service. This works fine:
But if I declare the input to be of type
hug.types.text
usingthe textarea value raises an error "Incorrect text value" and does not get interpreted correctly, returning
(I think this worked before I upgraded ubuntu, python and hug, but am unfortunately not 100% sure.)
The relevant form bit: