Closed bryanapellanes-okta closed 4 years ago
The execution path relevant to this change is as follows:
instantiate OktaClient -> register PayloadHandler -> client.PostAsync -> dataStore.PostAsync -> requestExecutor.PostAsync -> httpRequestMessageProvider.CreateHttpRequestMessage -> payloadHandler.SetHttpRequestMessageContent -> client.SendAsync
Below are links to the relevant tests.
[x] assert that instantiating OktaClient registers PkixCertPayloadHandler (https://github.com/okta/okta-sdk-dotnet/blob/OKTA-295020-content-types/src/Okta.Sdk.UnitTests/OktaClientShould.cs#L347)
[x] assert that setting ContentType sets the PayloadHandler (https://github.com/okta/okta-sdk-dotnet/blob/OKTA-295020-content-types/src/Okta.Sdk.UnitTests/HttpRequestShould.cs#L19)
[ ] assert that Publish* methods call PostAsync
@laura-rodriguez See above, let me know if you want to go over this together.
Merging as is; known issue will be addressed in follow up.
Issue \
OKTA-295020 OKTA-302822
Code
Current behavior
The OktaClient is hard coded to only send Content-Type headers with the value of "application/json".
Desired behavior
Enable a developer to override the default Content-Type header with an alternative value when necessary.
Additional Context
Some endpoints require Content-Type header values other than "application/json", see https://developer.okta.com/docs/reference/api/apps/#request-example-45
This PR also includes POST support for collections.