0

I have a question about retrieving data from a client who is using java and i am using vb.net. I am expecting a form posted to me and read the data.

My issues is when i do Request.Form("DATA") i get nothing from the client. Now if i create a html form and post it to my url with the field "DATA" i can read everything fine. I can also loop through my form and see the field and the button if i right them out to the screen or to a text file. Code is below

    response.write(Request.Form("DATA"))

OR

    Dim entryName As String
    For Each entryName In Request.Form
       response.write("Entity Name: " & entryName)
    Next

Either method above works fine for me but not for the client. When the client hits my page i see nothing at all no buttons no fields, nothing.

I am concerned he is not posting properly to me. I spoke with the developer and he said he would retrieve the data on his end by doing something like "Request.getparameter"

I do not know java at all but from what i read it sounds like "Request.getparameter" will grab any field out of a form or querysting that has the name specified aka my "DATA" field that i am looking for.

Can anyone explain to me what request.getparameter means in java and what the equivalent code would be in vb.net?

Again i do not know java at all and have searched on this for a while but cant quite find a definitive answer.

Thanks in advance.

squinny
  • 79
  • 4
  • 12

1 Answers1

1

It is correct that in Java, request.getParameter("DATA") will look in both the query string and posted form data, while in .NET, Request.Form("DATA") only looks at posted form data. Therefore, it seems likely that your client is sending the data in the query string, since you are not seeing it.

You have a few options. You could use Request.QueryString("DATA") to check only the query string, or either Request.Item("DATA") / Request("DATA") or Request.Params("DATA") to check both the query string and posted form data, plus cookies and server variables. I think Items and Params may be a little different in what they return, e.g. for multiple values. They are probably the closest equivalent to the Java request.getParameter function.

Mark
  • 8,140
  • 1
  • 14
  • 29
  • Thanks mark, However if it was in the querystring i would assume i would see it in IIS logs, which i do not i have put in place the Request.Params("DATA") and will see what comes from that. Is there any other common way of sending information aside from forms or querytstring that i may be missing? – squinny Jun 05 '14 at 12:37
  • @squinny It looks like logging the query string [may be optional](http://stackoverflow.com/a/19920936/2278086) in IIS, but I'm not sure if it's the default. I suppose I would usually use Fiddler to examine the request, but since you are not submitting it, that's out - not sure if there is a server-side equivalent. [This question on Server Fault](http://serverfault.com/q/90943) may give some ideas for how to log the incoming requests. – Mark Jun 05 '14 at 14:48