Click here to Skip to main content
14,700,124 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have asp.net with vb web application,in that i need to use http post method with 3 parameters, one of the parametes in byte format.I am new to http post method in server side, i am famler with clint side json method. but to use in server side with 3 parameters.

What I have tried:

Dim url = "https://testgateway.com"
            Dim client = New WebClient()
            Dim method = "POST"
            Dim parameters = New NameValueCollection()
            parameters.Add("parameter1", stry)  ' Base64String format
            parameters.Add("parameter2", strJSON)  ' Base64String format 
            parameters.Add("parameter3", aa)  ' Base64String format
            Dim response_data = client.UploadValues(url, method, parameters)
            Dim responseString = UnicodeEncoding.UTF8.GetString(response_data)


I am used above code Is it correct way, but it return "Invalid Request"

Pls help to solve this problem.

Regards,
Aravind
Posted
Updated 26-Aug-20 18:42pm
v2

1 solution

We can't help you: we have no idea what site you are trying to load data from, and the one you show isn't registered which might be the cause of your problem. We have no idea what value you are passing to it, or what values it expects.

Start with the URL, check that you are using what you think you should, and check the site's documentation to find out what it expects, if any.
   
Comments
Aravindba 21-Aug-20 2:08am
   
Hi,
Could u provide any HTTP post method sample code in vb.net using some public url in vb. form that i will make up my code, and i cant specify url , bcz its confident with our organisation, so i provide just dummy url and for 3 parameters 1 and 2 parameters are string and 3rd parameter are byte , so pls provide some sample vb code which pass 3 parameters.

Thanks
OriginalGriff 21-Aug-20 2:26am
   
Try Google!
https://www.google.com/search?q=HTTP+post+method+sample+code+in+vb.net&oq=HTTP+post+method+sample+code+in+vb.net&aqs=chrome..69i57&sourceid=chrome&ie=UTF-8
Aravindba 26-Aug-20 23:42pm
   
Hi, that 3 parameters i converted to base64string format, is it correct way above i used httpt post method ? bcz i am not know about http post method in vb, is it correct ? leave above url and it content, just say it is correct ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900