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

Feature request: make readyStates public #39

Closed
woutput opened this issue Apr 4, 2021 · 1 comment
Closed

Feature request: make readyStates public #39

woutput opened this issue Apr 4, 2021 · 1 comment

Comments

@woutput
Copy link

woutput commented Apr 4, 2021

Hi and thanks for sharing this library.

Wouldn't it be better if we (users of this library) could use

void some_callback(void* optParm, asyncHTTPrequest* request, int readyState)
{
    if(readyState == readyStateDone)
    {

instead of

void some_callback(void* optParm, asyncHTTPrequest* request, int readyState)
{
    if(readyState == 4)
    {

Currently (v.1.2.2) I see this in asyncHTTPrequest.h:

  private:
...
    enum    readyStates {
                readyStateUnsent = 0,           // Client created, open not yet called
                readyStateOpened =  1,          // open() has been called, connected
                readyStateHdrsRecvd = 2,        // send() called, response headers available
                readyStateLoading = 3,          // receiving, partial data available
                readyStateDone = 4} _readyState; // Request complete, all data available.

Maybe moving this enum definition to the public: part would already solve this feature request?

Thank you,
Kind regards,
woutput

@boblemaire
Copy link
Owner

These states are pretty much standard with javascript requests. I would just want to modify them to be less generic and unambiguously unique to this class, to avoid any conflicts. So I'm going to close this and leave the door open for a PR with unique names.

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