Reading a remote server's POST response to my server's POST and GET commands
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Reading a remote server's POST response to my server's POST and GET commands

  1. #1
    Join Date
    Oct 2013
    Posts
    6

    Reading a remote server's POST response to my server's POST and GET commands

    I'm new to C#. I have some questions about POST and GET communication between two servers:

    1. I put together a WebRequest to Http POST to a remote server. I want to read the response from the remote server, which will be a POST to my server.
    Will a HTTP WebResponse using a StreamReader be sufficient to read the remoter server's POST response? If not, do I need to use the HttpListener to receive that POST?

    2. This question is similar to the previous. I need to implement a Http GET command to retrieve data from the remote server's .shtml page.
    I used a WebRequest with the GET cmd. Next, I used a StreamReader to get the page. I then used the WebResponse with a StreamReader
    to read the other server's POST response. Is this the appropriate approach to GET data from the .shtml page and read the remote server's POST response?
    If not, do I need to use the HttpListener to receive that POST? The attached code is what I've done.

    Thanks for any suggestions, -KW
    Attached Files Attached Files

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,473

    Re: Reading a remote server's POST response to my server's POST and GET commands

    What happens when you try the code? Does it work?

  3. #3
    Join Date
    Oct 2013
    Posts
    6

    Re: Reading a remote server's POST response to my server's POST and GET commands

    Quote Originally Posted by Arjay View Post
    What happens when you try the code? Does it work?
    No. I haven't debugged it with the remote server yet. I was hoping someone has tried something similar and could comment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center