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. CHttpFile::EndRequest Fails

CHttpFile::EndRequest Fails

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminhelp
1 Posts 1 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.
  • Y Offline
    Y Offline
    yaminisridaran
    wrote on last edited by
    #1

    I am trying to use POST url to the server using CInternetSession ,CHttpConnection,CHttpFile But I am getting exception when excuting EndRequest The format i have to post is: POST /axis-cgi/audio/transmit.cgi HTTP/1.0\r\n Content-Type: audio/basic\r\n Content-Length: 9999999\r\n Connection: Keep-Alive\r\n Cache-Control: no-cache\r\n \r\n <Audio data> <Audio data> <Audio data> My Code is : CInternetSession session; CHttpConnection *m_pConnection; CHttpFile* pHTTP; CString strPreFileData; strPreFileData = "Content-Type: audio/basic\r\n"; strPreFileData += "Content-Length: 9999999\r\n"; strPreFileData += "Connection: Keep-Alive\r\n"; strPreFileData += "Cache-Control: no-cache\r\n"; strPreFileData += "\r\n"; CFile fTrack; if (FALSE == fTrack.Open(strFullPath, CFile::modeRead )) { AfxMessageBox(_T("Unable to open the file.")); return FALSE; } dwReadLength = fTrack.Read(pBuffer, 200); m_pConnection=session.GetHttpConnection("10.200.11.63", (INTERNET_PORT)80, "root", "root"); pHTTP = m_pConnection->OpenRequest(CHttpConnection::HTTP_VERB_POST, "axis-cgi/audio/transmit.cgi"); pHTTP->AddRequestHeaders(strPreFileData); pHTTP->SendRequestEx(240,HSR_INITIATE,0); pHTTP->Write(pBuffer, 240); pHTTP->EndRequest(); Please Help me regarding this S.Yamini

    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