miguelgrinberg / flasky

Companion code to my O'Reilly book "Flask Web Development", second edition.
MIT License
8.52k stars 4.2k forks source link

While testing client requests, how get/post by endpoint instead of url? #548

Closed cllen closed 1 year ago

cllen commented 1 year ago

Hi, I want to do like following, is it possible to do so?

for example:

client = app.test_client()
response = client.post('foo.buleprint.endpoint')

thanks for help!

miguelgrinberg commented 1 year ago

This is more of a Flask question and not related to this tutorial. The answer is no, I don't believe you can pass an endpoint name instead of a URL.

cllen commented 1 year ago

thanks!