• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 539
  • Last Modified:

POST data with CHtmlView and read from an ASP script

Hi,
I'm facing difficulties in submitting data to an ASP script using POST method with CHtmlView Navigate method. The ASP script can not seem to read the values. Can anyone help?
thanks
0
nitshv
Asked:
nitshv
1 Solution
 
ShaunWildeCommented:
what does your asp code and MFC code look like ?
0
 
DanRollinsCommented:
I hit this problem and came away from an important client's phone call with a red face.  I had forgotten to indicate the post Content-type.  I had to add the Content-type line to my headers:

m_sMyHeaders.Format(
   "Accept: text/*\r\n"
   "Content-Type: application/x-www-form-urlencoded\r\n"
   "User-Agent: MYPROG %s\r\n",
  (LPCSTR) CSTR_AppVer
);

....

int nLen= m_sFormData.GetLength();
pFile->SendRequest(
    m_sMyHeaders, (LPVOID)(LPCTSTR)m_sFormData, nLen
);

=-=-=-=-=-=-=-
That could the the problem, but only if everything else about the request is correct.

-- Dan
0
 
nitshvAuthor Commented:
Thanks Dan, that was exactly wut was missing.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now