Questions tagged [getasync]
50 questions
7
votes
2 answers
HttpClient GetAsync with query string
I am using Google's GeoCoding API. I have two methods where one works and the other doesn't and I can't seem to figure out why:
string address = "1400,Copenhagen,DK";
string GoogleMapsAPIurl =…

Oliver Nilsen
- 1,017
- 2
- 12
- 32
4
votes
1 answer
Httpclient GetAsync Fails(503 Service Unavailable) inside Web API on IIS Server
I have a simple web api that will retrieve a image file and return the bytes to the caller. It will work when I host the api project inside visualstudio in local (IIS Express), however, it will fail when I publish this project to my IIS server.…

L.T.
- 673
- 7
- 16
4
votes
1 answer
client.GetAsync doesn't refresh my data
I develop au Universal App using MVVM-Light.
On a page, there is a list of comments coming from a WebService. If the current user is the author of a comment, I show a FlyoutMenu allowing him to "Edit" or "Delete" its comment. There is also a…

Gold.strike
- 1,269
- 13
- 47
3
votes
1 answer
Consume restful API get method with content(body) or more than one parameter
This is my API method and it takes 3 parameters from body
public async Task> GetIdCondByDTRuta(EnCurso encurso)
{
var db = dbConnection();
return await…

Techy Hernández
- 149
- 2
- 11
3
votes
1 answer
Does all methods of HttpClient internally invoke SendAsync method?
Does all methods of HttpClient i.e. GetAsync, PostAsync etc. internally invoke SendAsync method?

shou
- 143
- 1
- 1
- 6
3
votes
1 answer
HttpClient.GetAsync, Invalid URI exception
The below mentioned code doesn't work. I get the following exception in GetAsync:
Invalid URI: The format of the URI could not be determined.
However, if I comment the apiClient.BaseAddress and specify the full URI in apiClient.GetAsync then it…

Ashish
- 59
- 1
- 4
2
votes
1 answer
Getting authorization for Zoho APIs
I am trying to follow Zoho's guide for getting authorized via OAuth. Unfortunately, the guide seems a little outdated as the API Console doesnt look like the screen shots provided in the guide.
This is what I am trying to accomplish
I'm developing a…

AlvinfromDiaspar
- 6,611
- 13
- 75
- 140
2
votes
0 answers
Guzzle getAsync php laravel pass variable to promise
I am looping through a DB of users to pass data to an API to validate addresses via getAsync. I need to update my DB record based on what the API returns. Problem is that I can't figure out how to pass $user->id to the promise to update the…

pete
- 1,023
- 1
- 10
- 15
2
votes
1 answer
How to wait for HttpClient GetAsync call until it returns the request in C#
I am trying to get data by the HttpClient. Data vary in size, it could be from few bytes to megabyte. I noticed many times my application exist even before it returns from the GetAsync. How can I wait until GetAsync complete it call? From the…

masiboo
- 4,537
- 9
- 75
- 136
2
votes
1 answer
HttpClient GetAsync fails randomly
I am using .net HTTPClient across multiple multithreaded consumers making GetAsync web requests to a local service at 127.0.0.1 once per second.
The web requests complete 99.9% of the time but occasionally a few requests (over a 3-4 hour period) …

Grant G
- 21
- 4
1
vote
1 answer
postAsync returns status as 200, ok but response.content is empty while data is returned in postman
I am using .net 6.0 minimal api with the below simple code in c#
app.MapGet("/", () =>
{
return $"{{\"error\":\"0\", \"message\":\"\", \"rows\":\"0\", \"data\":\"It is working !\"}}";
});
My client side code in c# is as below
using…

Srikanth S
- 1,717
- 5
- 16
- 21
1
vote
1 answer
C# HttpClient GetAsync exception "The server returned an invalid or unrecognized response"
This seems to be a random issue. Sometimes the GetAsync successfully gets a response (200/OK). Other times it throws an exception.
I'm thinking it has something to do with the "Transfer-Encoding: chunked".
BTW...the streamed files are anywhere from…

MartinN
- 51
- 1
- 6
1
vote
1 answer
Can't see the JSON result of a Get request in postman and shows empty string array
I have an ASP.NET CORE application that sends a POST/GET request to a REST (Orthanc Rest API). The issue is I receive the result and convert it to a JSON, but postman shows as an empty array. here is my code:
// GET Method
public class…

Hamidreza Ghaderi
- 11
- 1
- 3
1
vote
2 answers
C# Concatenate URL with 2 or more strings in between the url
trying to get a list of dates, I need to add 2 strings in between the URL
Cant concatenate the URL right
Need help deserializing into a DateTime list
public async Task
- >GetDate()
{
// Original Url …

Pxaml
- 651
- 2
- 12
- 38
1
vote
1 answer
Debugger Stops while Parsing Rest API response HttpClient, Xamarin Forms
I am trying to parse response from ASP.NET Core Web API. I am able to parse the response JSON into C# object successfully but app crashes without throwing any error when the parsed C# object is returned to the ViewModel.
in ViewModel
ApiResponse…

Tisha Anand
- 309
- 5
- 18