C++ and libcurl are being used.




How do I post "request payload" data?
FYI I did ask this on stack overflow and cplusplus but I really need a response ASAP so I apologize in advance. And yes I have googled this however the examples I find seem to rely on the content type being "JSON", and it doesn't seem like that is the case here... where do I incorporate this webkit form boundary? Do I use the header libcurl functions to declare content type and then POST as is? It doesn't seem to work when I do that..

My POST Request as is:

Code:

    struct curl_httppost *datathree = NULL;
      struct curl_httppost *lastthree = NULL;
      
  
    curl_formadd(&datathree, &lastthree, CURLFORM_PTRNAME, "__VIEWSTATE", CURLFORM_PTRCONTENTS, "", CURLFORM_END);
    curl_formadd(&datathree, &lastthree, CURLFORM_PTRNAME, "ctl00$Pager", CURLFORM_PTRCONTENTS, "", CURLFORM_END);
    curl_formadd(&datathree, &lastthree, CURLFORM_PTRNAME, "__EVENTTARGET", CURLFORM_PTRCONTENTS, "ctl01$TC$BBD_ISSUE_RPTLink", CURLFORM_END);
    curl_formadd(&datathree, &lastthree, CURLFORM_PTRNAME, "__EVENTARGUMENT", CURLFORM_PTRCONTENTS, "", CURLFORM_END);
    curl_formadd(&datathree, &lastthree, CURLFORM_PTRNAME, "__EVENTVALIDATION", CURLFORM_PTRCONTENTS, "/wEWFAL+raDpAgLUy9G7AwLH6/qKCgKDnbntDgLH0vqJCAK5l5O1CQK42rCNBQKM4fNgAufEqeEHAoe/ytQJAvvQvU4C96OJow0C3YnIpgsC0a3s6A0CroaZiAYC28K51g4CpLPr/gcC46L8ww0Cq83cug4C0+nlwAwxZ4GmkToRQbkohSZ9EcEl40hsHA==", CURLFORM_END);
    curl_formadd(&datathree, &lastthree, CURLFORM_PTRNAME, "__LASTFOCUS", CURLFORM_PTRCONTENTS, "", CURLFORM_END);






    curl_easy_setopt(myHandle, CURLOPT_HTTPPOST, datathree);

Code:
Response Headers:


Content-Type: text/html; charset=utf-8


Request Headers:


Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryG82cUGis7lmfHL19






Request Payload:


  ------WebKitFormBoundaryG82cUGis7lmfHL19
    Content-Disposition: form-data; name="__VIEWSTATE"




    ------WebKitFormBoundaryG82cUGis7lmfHL19
    Content-Disposition: form-data; name="ctl00$Pager"




    ------WebKitFormBoundaryG82cUGis7lmfHL19
    Content-Disposition: form-data; name="__EVENTTARGET"


    ctl01$TC$BBD_ISSUE_RPTLink
    ------WebKitFormBoundaryG82cUGis7lmfHL19
    Content-Disposition: form-data; name="__EVENTARGUMENT"




    ------WebKitFormBoundaryG82cUGis7lmfHL19
    Content-Disposition: form-data; name="__EVENTVALIDATION"


    /wEWFAL+raDpAgLUy9G7AwLH6/qKCgKDnbntDgLH0vqJCAK5l5O1CQK42rCNBQKM4fNgAufEqeEHAoe/ytQJAvvQvU4C96OJow0C3YnIpgsC0a3s6A0CroaZiAYC28K51g4CpLPr/gcC46L8ww0Cq83cug4C0+nlwAzDcbaDFsCek7cLKaKs8kyafpbT3w==
    ------WebKitFormBoundaryG82cUGis7lmfHL19--