Kundan Jha
Kundan Jha

Reputation: 104

Passing Parameters to a post httpweb request in asp.net for vb net code

Hi guys actually I am new to asp.net and had a task to do. I wast to call a api in post method with certain input paramater and in return I get gst address details. The input is as follows:

This is the purpose of this api: This Service returns GST details (Address,OwnerName,Pincode,etc.)

**Link**=www.mylink.net/gstdata/gst
**method**= post
**input parameters**=> modid,key,gst (All are string types)

I provide gst no and in return gets the address.

Service Output parameters:

**Parameters    Possible Values**
**code**           200,400,500
**status**         FAILURE/SUCCESS
**error**          string
**data**           1.values (map - key=column_name ,value=column_value)
**uniq_id**        string

How do I get these values using HttpWebRequest parameter in vb net code? Please help

Upvotes: 0

Views: 547

Answers (1)

fazioli fairmont
fazioli fairmont

Reputation: 111

I would use

Dim WC as new WebClient
Dim HTML as string = WC.downloadstring("http://example.com/GetAdres?of=John")

Now you will have the Actual HTML of your service output. to further process it, we will need a little more information.

It is not clear to me how the service output is actually formatted, for this we need an example in raw HTML. can you please PASTE the actual Source code of the WebPage to me? the real source in source code, do not copy the document itself.

Security note

do not send the pincode... keep it on the server, and send the pincode to the server instead when it needs to be compared.

Upvotes: 1

Related Questions