No announcement yet.

https posting

  • Filter
  • Time
  • Show
Clear All
new posts

  • https posting

    I am new to and and cannot figure out how to post an XML file to another server that will accept my post.

    I have a web server IIS 6.0 up and running with and SSL certificate.
    The instructions to post tell me to do the following:

    Sample Post:
    POST /URL Provided to you by SS HTTP/1.1
    Authorization: Basic c3NxYTpYaWFvRG85Ng==
    Content-Type: text/xml
    Content-Length: 1142
    Expect: 100-continue
    HTTP/1.1 100 Continue
    ...<?xml version="1.0" encoding="utf-8"?>
    <Message xmlns=""
    <To>mailto:[email protected]</To>
    <From>[email protected]</From>

    I have the URL I am supposed to post to and I know how to create the XML message but I cannot figure out how to actually create the header in and have it sent to the URL Provided to SS.APSX

    I tried doing a simple <FORM> with a file input using the URL as the desintation and all I get is the XML file has invalid characters? (there are no invalid characters in the xml?)

    I tried using Windows API functions (InternetConnect, InternetOpen...) and I get a message that my certificate is invalid (it is not invalid!).

    Can some one help me out with this one?


  • #2
    Re: https posting

    You might have more success posting this kind of question on a programming site like Stack Overflow or the like.

    Anyway, you do not want to set up the headers by hand. Just use System.Net.WebRequest class, which will populate the headers automatically based on request parameters. Take a look at these articles at MSDN and C# Online.