Donmai

Getting 403 forbidden when trying to get json

Posted under Bugs & Features

I wanted to make a simple imageboard for a student project on ASP.NET. For this I decided to use API from booru. But when I try to make the following request:
var response = await _httpClient.GetAsync($“https://safebooru.donmai.us/posts.json?tags={tags}&limit={limit}”);

I get Forbidden 403 every time. At the same time exactly the same request just in the browser line works fine=/

I think you should specify which HTTP headers your _httpClient sends and what is contained in your variables tags and limit.
Is your ASP.NET application and the browser on the same device or at least on the same network?

1