Private Function PostApiCall(txtV As String) As String
Try
Dim endPoint As String = "https://gorest.co.in/public-api/users"
'Contruct Json Request
Dim dictData As New Dictionary(Of String, Object)
dictData.Add("FetchStart", txtV)
dictData.Add("FetchSize", "uday")
dictData.Add("CustomerName", "gundeti")
dictData.Add("gender", "male")
'Params
Dim reqString() As Byte
Dim resByte As Byte()
Dim responseFromApi As String
Dim client As WebClient = New WebClient()
client.Headers("Content-type") = "application/json"
'client.Headers("Authorization") = "Basic " & Convert.ToBase64String(Encoding.[Default].GetBytes("username:password"))
client.Headers("Authorization") = "Bearer elHd6Cv3Ae2P70mPvfPx9gNnjfbHU-kd9FID"
client.Encoding = Encoding.UTF8
Dim jsonReq = JsonConvert.SerializeObject(dictData, Formatting.Indented)
reqString = Encoding.Default.GetBytes(jsonReq)
resByte = client.UploadData(endPoint, "post", reqString)
responseFromApi = Encoding.Default.GetString(resByte)
Return responseFromApi
Catch ex As Exception
Throw (ex)
End Try
End Function