HTTP Post request with tab delimited field
-
19-04-2021 - |
Domanda
I've been asked to set up a web service for account creation. The inbound HTTP Post request contains a single formatted field containing tab delimited fields with a header line wrapped in tags.
Here's a sample:
accountRequest=<NewUser>
userName password fName lName
ABC123 wzbtw88g Joe Bloggs
</NewUser>
Can anyone help me understand how to parse it with Classic ASP?
Soluzione
extract the values into a string and do something like this
<%
str="userName password fName lName ABC123 wzbtw88g Joe Bloggs"
arr=split(str,vbTab)
for i=lbound(arr) to ubound(arr)
response.write i & "=" & arr(i) &"<BR>"
next
%>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow