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

The o parameter of the JSONRequest function #7

Open
iBigDane opened this issue May 10, 2023 · 2 comments
Open

The o parameter of the JSONRequest function #7

iBigDane opened this issue May 10, 2023 · 2 comments
Labels

Comments

@iBigDane
Copy link

auth   = MicroWebCli.AuthBasic('toto', 'blah123')
result = MicroWebCli.JSONRequest('http://my-web-site.io/my-api/user/12', auth=auth)
print('User name is %s %s' % (result.firstname, result.lastname))

found by the example above.
If the o parameter of the JSONRequest function is not specified, then the function is GETRequest function.

@jczic
Copy link
Owner

jczic commented May 11, 2023

Hello @iBigDane,
Yes, without JSON content, it is a GET instead of a POST (content length of zero and no json content type).
However, a JSON response to the request (GET or POST) will in all cases be expected and translated into a python object.
Doesn't that make sense to you?

@jczic jczic added the wontfix label May 11, 2023
@iBigDane
Copy link
Author

Hello @iBigDane, Yes, without JSON content, it is a GET instead of a POST (content length of zero and no json content type). However, a JSON response to the request (GET or POST) will in all cases be expected and translated into a python object. Doesn't that make sense to you?

Thanks, I see

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

No branches or pull requests

2 participants