10 TIPs - To Become a Good Developer/Programmer
Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
user yasir
2.1k
5
223
I want to get some data from web with access token.
Sep 24 2018 4:04 AM
This code is not working for me,
public async Task callapi()
{
try
{
RestClient client = new RestClient("https://mytest.syncloft.com/");
client.ClearHandlers();
RestRequest request = new RestRequest("shop/sync-discounts", Method.GET);
request.RequestFormat = DataFormat.Json;
request.AddHeader("content-type", "application/json");
request.AddHeader("Authorization", "Bearer" + accessToken);
var response = await client.ExecuteTaskAsync(request);
if (response != null)
{ Console.Write(response); }
else { Console.Write("Error0"); }
} catch(Exception exc)
{ Console.Write(exc.ToString()); }
}
Reply
Answers (
1
)
To Create a timer and to print data using a new Thread
abstract class and Interface