ISSUE:
While passing data-urlencode values via OAUTH 2 in HTTP client, We were getting error message-”HTTP_01 - Error fetching resource. HTTP-Status: 400 Reason: Bad Request”.
The endpoint is microsoftonline oauth2. When we run below query in postman it works.
curl --location --request GET 'https://login.microsoftonline.com/<xxx>/oauth2/v2.0/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=<stripped>' \
--data-urlencode 'client_secret=<stripped>' \
--data-urlencode 'scope=https://xxx.com/.default'
but this is not working when we do this in HTTP client with below configuration.
Configuration:
Error Message:
HTTP_01 HTTP_01 - Error fetching resource. HTTP-Status: 400 Reason: Bad Request
Resolution:
- Do add below property in HTTP
- accept:*/*
- accept:*/*
- We might be getting few error which can be fixed by following below process
- Error-"HTTP_00 - Cannot parse record. HTTP-Status:200
cause:Reason:com.streamsets.pipeline.api.ext.io.OverrunException:Reader exceeded the read limit '1048576" then
Solution:- Update "parser.limit=104857600" on sdc.properties.Do remove the leading #
- restart the sdc.
- Error-Max object length exceeded from 4096.
Solution:Update the Max object length to 2147483647 in the data format tab under HTTP stage section.
- Error-"HTTP_00 - Cannot parse record. HTTP-Status:200