What is the maximum URL length you can pass to the Wininet function, HttpOpenRequest?

前端 未结 3 967
清歌不尽
清歌不尽 2021-01-22 00:32

What is the maximum URL length you can pass to the Wininet function, HttpOpenRequest?

3条回答
  •  独厮守ぢ
    2021-01-22 00:57

    There are some max length consts in WinInet.h:

    ...
    //
    // maximum field lengths (arbitrary)
    //
    
    #define INTERNET_MAX_HOST_NAME_LENGTH   256
    #define INTERNET_MAX_USER_NAME_LENGTH   128
    #define INTERNET_MAX_PASSWORD_LENGTH    128
    #define INTERNET_MAX_PORT_NUMBER_LENGTH 5           // INTERNET_PORT is unsigned short
    #define INTERNET_MAX_PORT_NUMBER_VALUE  65535       // maximum unsigned short value
    #define INTERNET_MAX_PATH_LENGTH        2048
    #define INTERNET_MAX_SCHEME_LENGTH      32          // longest protocol name length
    #define INTERNET_MAX_URL_LENGTH         (INTERNET_MAX_SCHEME_LENGTH \
                                            + sizeof("://") \
                                            + INTERNET_MAX_PATH_LENGTH)
    ...
    

提交回复
热议问题