Re: Problem with xmlhttp
- From: Mr. Smart <MrSmart@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 24 Sep 2007 05:56:01 -0700
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 specifiedthat
complete URL. The xmlhttprequest object actually works. The only problem
I have is that ALL spaces are removed from what I was actaully trying toImagine
post. Admittedly, I did not use xml. I used content of a text object.
a text object that has a couple of text: I love programming (say). After Iexamples
posted it using the post command of xmlhttprequest, this is what I got:
Iloveprogramming, which is certainly not what I want. From all the
that I saw, everybody used setRequestHeader "Content-type",learnt
"application/x-www-form-urlencoded" command. When I checked that up, I
that it is part of the header which has to be specified. Please would yoube
good enough to post a sample code that I can use to post dataURL
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
saving.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 theserver,
let user make changes and then post it back.
I successfully retrieved the data, however there is a problem is
howHere 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:
Whatold
are u? It posts it as howoldareu?. That is, it removes ALL spaces.
do I
do so that the spaces are not removed?
Thanks very much for the anticipated supply
- Follow-Ups:
- Re: Problem with xmlhttp
- From: Tony Proctor
- Re: Problem with xmlhttp
- References:
- Re: Problem with xmlhttp
- From: Tony Proctor
- Re: Problem with xmlhttp
- From: Tony Proctor
- Re: Problem with xmlhttp
- Prev by Date: SOFTWARE TESTING JOBS IN ORACLE,WIPRO.......MNC'S
- Next by Date: Re: Problem with xmlhttp
- Previous by thread: Re: Problem with xmlhttp
- Next by thread: Re: Problem with xmlhttp
- Index(es):
Relevant Pages
|
|