microsoftgraph / microsoftgraph/msgraph-sdk-go
Upload app logo resulted in Error
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 335
- Forks
- 43
- Avg merge
- 15h 19m
- Merged PRs (30d)
- 3
Description
Using the below code to upload an Logo for a given App:
headers := abstractions.NewRequestHeaders()
headers.Add("Content-Type", "image/jpg")
configuration := &applications.
ItemLogoRequestBuilderPutRequestConfiguration{
Headers: headers,
}
appLogo, err := os.ReadFile(appLogoFile)
resp, err := client.Applications().ByApplicationId(appObjectID).Logo().Put(
ctx,
appLogo,
configuration,
)
However this results in the below error:
content type text/html does not have a factory registered to be parsed
On debugging further it was found that the APi call results in a a Bad Request 400 erro and the same is getting set in response body resulting in above error.
Looks like Content-tye is set to 2 values image/jpeg and application/octet-stream . Not sure if this is causeing the request to the MS graph API to fail
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Applications().ByApplicationId(...).Logo().Put entry point and reproduce the request with the headers and image data shown. Inspect the outgoing Content-Type values and the Microsoft Graph 400 response, then verify the upload succeeds without the text/html parsing error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100