Re: Problem with xmlhttp



Thanks very much for the assistance. I've studied your example and I tried to
follow it. I have an error message. It says: HTTP 405 - Resource not allowed.
I guess I had the problem bcos I did not quite understand the sample code.

I modified my code to align with your recommendation. Now I modified the
parameter on the OPEN ststement to read: url = Website &
"/upload.asp&action=upload&ocx=messages&usercode=" & Usercode. It evaluates
to:
http://localhost/upload.asp&action=upload&ocx=messages&usercode='1293635589'.
However, I don't understant the send statement. I feel that is where I am
having problem. This is the sample code u gave which I copied and pasted:
"<Request Type='Diagnostic'></Request>. Could you give more explanation on
it. Perhaps, you can give an example with a variable (say vrb1) that has the
content: Programming is fun. Thanks once again for taking time to assist.

"Tony Proctor" wrote:

I'm questioning what you're specifying on the '.Send' call. Here's a sample
from a test app here:-

Dim oXMLHTTP As New MSXML2.XMLHTTP

With oXMLHTTP
.Open "POST",
http://MySrv/VirtDir/Test.asp&cls="MyClass&action=XMLHTTP";, False
.Send "<Request Type='Diagnostic'></Request>
Debug.Print "Status=" & .status & ", Response=" & .responseText
End With

There are both .responseText and .responseXML members available on the
XMLHTTP object. However, the content should still be XML since that's the
protocol you're using

Tony Proctor

"Mr. Smart" <MrSmart@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:89AC1F10-9B72-446C-891D-E28DA947FF6A@xxxxxxxxxxxxxxxx
Thanks Mr. Proctor for the kind assistance. However, I am sure I specified
complete URL. The xmlhttprequest object actually works. The only problem
that
I have is that ALL spaces are removed from what I was actaully trying to
post. Admittedly, I did not use xml. I used content of a text object.
Imagine
a text object that has a couple of text: I love programming (say). After I
posted it using the post command of xmlhttprequest, this is what I got:
Iloveprogramming, which is certainly not what I want. From all the
examples
that I saw, everybody used setRequestHeader "Content-type",
"application/x-www-form-urlencoded" command. When I checked that up, I
learnt
that it is part of the header which has to be specified. Please would you
be
good enough to post a sample code that I can use to post data

From the reply I got earlier, it seems it is bcos I used the above
urlencoded stuff, which I am ready to ditch for better better option.
"Tony Proctor" wrote:

With the xmlhttp object, you normally specify the complete URL on the
'.Open' and the XML to send on the '.Send'. You seem to have split your
URL
across both calls, and haven't provided any XML content at all.

If you only want to access a specific URL then the xmlhttp object isn't
quite what you need.

Tony Proctor

"Mr. Smart" <MrSmart@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:86D280CF-48A4-4A9C-80A0-D5A95D580224@xxxxxxxxxxxxxxxx
This is what I am trying to do. I want to retrieve some data from the
server,
let user make changes and then post it back.

I successfully retrieved the data, however there is a problem is
saving.
Here is the code:

url = "http://localhost/upload.asp";
Set RemoteServer = CreateObject("msxml2.xmlhttp")
RemoteServer.Open "POST", url, False
RemoteServer.setRequestHeader "Content-type",
"application/x-www-form-urlencoded"
Dim xyz As String
xyz = "message=" & Text1 & "&ocx=messages&usercode=" & Usercode
RemoteServer.send (xyz)

As an example, let's assume the content of text1 contains the text:
how
old
are u? It posts it as howoldareu?. That is, it removes ALL spaces.
What
do I
do so that the spaces are not removed?

Thanks very much for the anticipated supply






.



Relevant Pages

  • Re: Problem with xmlhttp
    ... Dim oXMLHTTP As New MSXML2.XMLHTTP ... I did not use xml. ... "Tony Proctor" wrote: ... If you only want to access a specific URL then the xmlhttp object isn't ...
    (microsoft.public.vb.com)
  • Re: Error extracting innerHTML using DHTML in an HTA page
    ... I will look at using the XMLHTTP object. ... on the Server side is the result of a rather complex FOR XML EXPLICIT SQL ... > Use the XMLHTTP object to request the xml from the server-side asp ...
    (microsoft.public.scripting.vbscript)
  • Re: Opening XML file over HTTPS with ADODB on a web page.
    ... My thinking is that I need a diferent connection string. ... You'll need to use an interstitial XMLHTTP object: ... We have code running that downloads persistence provider XML from an HTTPS ...
    (microsoft.public.data.ado)
  • Re: XMLHttpRequest + XMLDOM
    ... if the XMLHTTP object is running in the context of a browser ... and the XML resource is retrieved from the ... calling Saveon the DomDocument held by responseXML will ...
    (microsoft.public.dotnet.xml)
  • Re: Problem with xmlhttp
    ... "Tony Proctor" wrote: ... server accepts in terms of XML requests. ... assuming that the response will be XML ...
    (microsoft.public.vb.com)