octokit / source-generator

Generates SDKs from GitHub's OpenAPI specification. Built on Kiota.
8 stars 3 forks source link

Octocat request returns 415 #24

Closed kfcampbell closed 11 months ago

kfcampbell commented 11 months ago

When generating the SDK, building it, and making a request to the Octocat endpoint using the following code:

cat, err := client.Octocat().Get(context.Background(), nil)
if err != nil {
    log.Fatalf("error getting octocat: %v", err)
}
fmt.Printf("%v\n", string(cat))

The following is output: 2023/11/01 16:53:56 error status code received from the API. Debugging shows this error to be an HTTP 415, an unsupported media type error. It's likely we're not setting the correct headers for this request.