MSXML2.ServerXMLHTTP Call in ASP

10,311

Two suggestions:

1) I found this article, the result of which would be to change your content type header to xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"

2) Use Fiddler to analyze the request and make sure the headers and form data are sent.

Good luck

Share:
10,311
neojakey
Author by

neojakey

I am a one-man web studio offering a unique personalized web service. Originally from the UK, I now reside in Acapulco, Mexico (no joke). I am a highly skilled Classic ASP programmer, I work with Microsoft-SQL Server, Microsoft Access and MySQL. I can create all Back-End/Content Management & Front-End software, tailored to any requirements (including GUI, graphics and styling). Besides classic ASP, I program in ADO, SQL, T-SQL, Visual Basic, JavaScript, AJAX, HTML, XHTML and CSS. All my sites are built standards-compliant. I have experience designing, constructing and testing the following types of websites: Static HTML and Dynamic websites. Accounting and Administration software. E-Commerce and shopping-cart solutions. Corporate Intranet systems. I have done varied work, that has allowed me to gain knowledge from a wide selection of industry. This has lead to small business systems which have included internal messaging, invoice creation, stock control, quotation production and task management. This experience now allows me to offer wide reaching services, that many other web companies and freelancers may reject. I pride myself on personalized professional solutions that are made within budget and within time constraints. I always work closely with my clients, not only to ensure that they receive a quality product, down to the last pixel, but also a service that goes beyond. No matter your expectations, they will be surpassed.

Updated on June 04, 2022

Comments

  • neojakey
    neojakey almost 2 years

    I am using Confident Technologies Image Captcha and within their technologu I need to post to their servers, which in return will then pass back the HTML code. See: https://login.confidenttechnologies.com/docs/restful

    I have produced a an VBScript for this but I can get the results I need. The Function is :

    FUNCTION CreateSecurity()
      Dim nURL : nURL = "http://captcha.confidenttechnologies.com/captcha"
      Dim SendStr : SendStr =     "api_username=jqcsgvsi47g9BEgncu2Mb9pINE4W5tEYNPIwMHFR&api_password=pHm5IDZhLiaeY8raDStdEyoRiBeqoTSMDeFxkWcM&customer_id=K9PWSU6s&site_id=storeboard"
      Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
      xmlhttp.open "POST", nURL, false
      xmlhttp.setRequestHeader "Content-Type", "application x-www-form-urlencoded"
      xmlhttp.send(SendStr)
      Response.write xmlhttp.responseText
      Set xmlhttp = nothing
    END FUNCTION
    

    I simply call this function where I want the capture to appear. However when I call the function I get the following result:

    Bad Request

    site_id may not be blank.

    api_password may not be blank.

    api_username may not be blank.

    customer_id may not be blank.

    See Results: http://www.storeboard.com/join_now_new.asp

    Does anyone know what I am doing wrong?

    Any help would be truly appreciated.

    Many thanks in advance, Paul