Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. A Question about ChttpFile

A Question about ChttpFile

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionlearning
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lxdff
    wrote on last edited by
    #1

    I'm learning VC++/MFC programming. I want post data to a webserver by http protocol,but it is errors Source followed: CString strHeaders =_T("Content-Type: application/x-www-form-urlencoded"); // URL-encoded form variables - // name = "John Doe", userid = "hithere", other = "P&Q" CString strFormData = _T("t=abcd"); CInternetSession session; CHttpConnection* pConnection = session.GetHttpConnection(_T("http://127.0.0.1/test.asp")); CHttpFile* pFile = pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST,_T("http://127.0.0.1/test.asp")); why the pFile is null? 6对9说:好好的,打什么倒立。0对8讲:胖就胖一点了,系什么腰带。7对2讲,别跪了,跪死了也不嫁给你。5对3讲:哼,再隆胸也是假的

    J T 2 Replies Last reply
    0
    • L lxdff

      I'm learning VC++/MFC programming. I want post data to a webserver by http protocol,but it is errors Source followed: CString strHeaders =_T("Content-Type: application/x-www-form-urlencoded"); // URL-encoded form variables - // name = "John Doe", userid = "hithere", other = "P&Q" CString strFormData = _T("t=abcd"); CInternetSession session; CHttpConnection* pConnection = session.GetHttpConnection(_T("http://127.0.0.1/test.asp")); CHttpFile* pFile = pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST,_T("http://127.0.0.1/test.asp")); why the pFile is null? 6对9说:好好的,打什么倒立。0对8讲:胖就胖一点了,系什么腰带。7对2讲,别跪了,跪死了也不嫁给你。5对3讲:哼,再隆胸也是假的

      J Offline
      J Offline
      Joel Lucsy
      wrote on last edited by
      #2

      lxdff wrote: session.GetHttpConnection(_T("http://127.0.0.1/test.asp")); GetHttpConnection requires a server, not a file. Try session.GetHttpConnection(_T("127.0.0.1")); Joel Lucsy (jjlucsy@ameritech.net)

      1 Reply Last reply
      0
      • L lxdff

        I'm learning VC++/MFC programming. I want post data to a webserver by http protocol,but it is errors Source followed: CString strHeaders =_T("Content-Type: application/x-www-form-urlencoded"); // URL-encoded form variables - // name = "John Doe", userid = "hithere", other = "P&Q" CString strFormData = _T("t=abcd"); CInternetSession session; CHttpConnection* pConnection = session.GetHttpConnection(_T("http://127.0.0.1/test.asp")); CHttpFile* pFile = pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST,_T("http://127.0.0.1/test.asp")); why the pFile is null? 6对9说:好好的,打什么倒立。0对8讲:胖就胖一点了,系什么腰带。7对2讲,别跪了,跪死了也不嫁给你。5对3讲:哼,再隆胸也是假的

        T Offline
        T Offline
        ttzzgg_80713
        wrote on last edited by
        #3

        兄台是那里人呀

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups