I don’t see anything else obvious, assuming this code generates the URL we think it does.
So we’d have to debug to make sure it’s constructing the URL we think it is.
Which brings us back to the first question
What did the code generate to call?
And, did it construct the header as expected?