Open jcvpacheco opened 4 years ago
@jcvpacheco could you please provide more details about the error response? I found one strange thing is that the hostname in URL is not the same as the one in Host
header.
Hi, thanks for the reply. With or without host define, is always returning this
@jcvpacheco can you work with other HTTP client tools like cURL, Postman?
using "rest-client.formParamEncodingStrategy": "always",
with Content-Type: application/x-www-form-urlencoded
works
I was having problems with multipart. In my case it just worked with a BlankLine before the value, and no BlankLine after.
Example:
POST https://MYOAUTH/connect/token HTTP/1.1 Host: MYHOST Content-Type: multipart/form-data;boundary=------MyBoundary
--------MyBoundary Content-Disposition: form-data; name="client_id"
MYCLIENT --------MyBoundary Content-Disposition: form-data; name="client_secret" Content-Type: application/x-www-form-urlencoded URL_Encode(MYSECRET )
--------MyBoundary Content-Disposition: form-data; name="scope"
MYSCOPE --------MyBoundary Content-Disposition: form-data; name="grant_type"
client_credentials --------MyBoundary--
@SamLino, not even all heroes wear cape!
I'm creating a REST client in ADVPL to consume an API that uses multipart/form-data, and your example saved my day. Thank you so much! 💚
When i'm trying to get the authorization token using the following format, and is returning the following error: "IdentityServer4 ",
POST https://MYOAUTH/connect/token HTTP/1.1 Host: MYHOST Content-Type: multipart/form-data;boundary=------MyBoundary
--------MyBoundary Content-Disposition: form-data; name="client_id" MYCLIENT
--------MyBoundary Content-Disposition: form-data; name="client_secret" Content-Type: application/x-www-form-urlencoded URL_Encode(MYSECRET )
--------MyBoundary Content-Disposition: form-data; name="scope" MYSCOPE
--------MyBoundary Content-Disposition: form-data; name="grant_type" client_credentials
--------MyBoundary--
This is the right format to make this type of requests? Many Thanks.