C
C#

help

Getting 403 forbidden when trying to call the Github API [Answered]

TThinker11/6/2022
I'm trying to call https://api.github.com/repos/thinker227/FolderTool/releases/latest to get the latest release from a repo, and accessing the API URL from the browser works perfectly fine, but when making the request from code using HttpClient.GetAsync() causes it to return 403 forbidden as a response. This just seems kind of odd, although maybe I'm just missing something. Am I like missing something with headers?
Ppox11/6/2022
You might need to create a access token to pass In the docs they use some custom Accept header, unsure if it's important here https://docs.github.com/en/rest/quickstart
TThinker11/6/2022
ugh wait hold on yeah I mean obviously the docs mention authentication, although it's completely possible to access the API without any authentication from the browser https://docs.github.com/en/rest/releases/releases#get-the-latest-release ah yeah now it works User-Agent: "b" yeah uh this works mweh
AAccord11/7/2022
✅ This post has been marked as answered!

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
apply height to sphere UNITYhow do I know on which vertices I apply which pixel of the height map (of earth)Cannot parse custom emoji string into Emoji objectHi, I am trying to react with a custom emoji as shown below ```csharp await socketMessage.AddReactioi dont understand why its erroring, streamreader is redI've been stuck on this for a while but I seriously don't know what to do, Total is supposed to showWrite to file not working (StreamWriter)```cs using System; using System.Numerics; using System.Text; using System.IO; namespace Username { Publishing a CLI tool as a single-file appSo I've made a CLI tool (see #showcase) which I would sort of like to be able to distribute without Phantom constraint`Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes.DBFirst one to one or zeroI have One Patient to One or No MedicalCard associated with him EF Generated the following code: `Error EfCoreWhat could be causing this error?Application works on Windows and WSL2 but fails in docker (Linux). Broken pipeI have an application that establishes a TCP connection to another Java application. For some reasMy code works - but is shows invalid string at the beggening for no reasonIt works but it disiplays invalid string at the start i want to get rid of it https://github.com/AbdWill this service will be disposed using DependencyInjection?I have the following class which is added to the default DI-container (Blazor WASM) ```csharp publicNested array in DataGridViewHello, i want to display object in DataGridView (WinForms) that has an array of values (plus some noWeb Application with separate protected areasI want to build a web app. All pages should require login. There should be a special area `/admin` wNaming conventions [Answered]I am arguing with my friend about what casing to use in variable names. To settle the argument whateuser input number errorim trying to make a thing where you get user input as a number and get the cube of it. i tried makinUse static functions in runtime code (rosyln)Hello, I'm trying to import a static class (`using static namespace.class`) into rosyln executing cWhen should we use immutable data structures?When should we use immutable data structures?How to refactor and unit test this method.``` [HttpPost] [Consumes(MediaTypeNames.Application.Json)] [ProducesResponseType(StatusCodes.Get directory tree of matching items [Answered]I've been trying to figure this out for the past two hours to little success. I essentially want a mSerial readingI use this code to read the values my arduino reads, and I use that in unity. However the datareceiv