Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 958433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:51:55+00:00 2026-05-16T00:51:55+00:00

The following code fRequestHandle = HttpOpenRequestA( fConnectHandle, POST, url.c_str(), NULL, NULL, NULL, INTERNET_FLAG_RELOAD|INTERNET_FLAG_NO_CACHE_WRITE, 0);

  • 0

The following code

fRequestHandle = HttpOpenRequestA(
                   fConnectHandle, 
                   "POST", url.c_str(), 
                   NULL, NULL, NULL,
                   INTERNET_FLAG_RELOAD|INTERNET_FLAG_NO_CACHE_WRITE, 
                   0); 

is returning NULL with GetLastError() returning 122. A search suggests this error is

122 (ERROR_INSUFFICIENT_BUFFER) The data area passed to a system call is too small. 

but gives no indication what buffer might be too small.

Which buffer might this relate to, and how can I make it bigger?

Update:

As has been pointed out, and detailed at http://support.microsoft.com/kb/208427, Internet Explorer, and presumably the wininet library, has a url limit of 2083 characters.

However looking at my url I find the url itself is around 40 characters. The 650k of data is in a name/value pair, for which wininet has no limit

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T00:51:56+00:00Added an answer on May 16, 2026 at 12:51 am

    In general, your url should be 2k or less in size. Since you are performing a POST, you are heading in the right direction, its just that for the bulk of your data, you want to pass that as the body of the HTTP request like in this example:

    POST /login.jsp HTTP/1.1
    Host: www.mysite.com
    User-Agent: Mozilla/4.0
    Content-Length: 27
    Content-Type: application/x-www-form-urlencoded
    
    userid=joe&password=guessme <--You need to do this!
    

    Cribbed from here: http://developers.sun.com/mobility/midp/ttips/HTTPPost/

    Here’s what I was thinking you would want to do:

    std::string url("http://host.com/url");
    
    std::string dataPayload("name=value&othername=anothervalue");//Query string payload style.
    DWORD dataPayloadLength = dataPayload.length();
    
    std::ostringstream headerStream;
    headerStream << "content-length: ";
    headerStream << dataPayloadLength;
    std::string headers = headerStream.str();
    
    DWORD headerLength = headers.length();
    
    HINTERNET handle = HttpOpenRequest(hConnect,
        "POST",
        url.c_str(), 
        NULL, NULL, NULL,
        INTERNET_FLAG_RELOAD|INTERNET_FLAG_NO_CACHE_WRITE, 
        0);
    
    if(!handle) {
        DWORD errorCode = GetLastError();
        //Handle error here.
    }
    
    //Use this thing to send POST values.
    if(! HttpSendRequest(handle,
        headers.c_str(),
        headerLength,
        dataPayload, //lpOptional <--Your POST data...not really optional for you.
        dataPayloadLength) {
    
        DWORD errorCode = GetLastError();
        //Handle error here.
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following code is generated by a for loop. <form action=saveresponse.php method=POST name=mainForm> <input class=cbox_yes
following code is used to find url from a string with php. Here is
Following code: def __init__(self, url, **kwargs): for key in kwargs.keys(): url = url.replace('%%s%' %
The following code is intended to do a purely ajax POST request, instead it
Following code generates a CA2000 warning: Myclass myclass = null; try { myclass =
Following code if (_LastMouseClickArea != null) { if (_LastMouseClickArea.GridItem == GridItem.DataCell) {... fails because
Following code produces a nested array as a result for keys containing three items:
Following code takes like 2500 milliseconds on an i7-*3.4 GHz windows-7 64-bit computer to
Following code worked fine abstract class FunctionRunnable<V> implements Runnable { protected abstract V calculate();
Following code: <%= render 'shared/error_messages', f.object %> where f.object is instance of a class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.