Search code examples
jsonrestweb-servicespostmanform-data

Postman request with body Form data to json


I have a problem with postman...

For one side, I can make this request with the body in form data. enter image description here

But, when I try to send the same request with the body in raw(json) I got this:

enter image description here

I am trying to send the data via Angular 5 to a Drupal 8 Backend.

Thanks!


Solution

  • It will depend if the backend can receive a JSON format.

    In my case, I am working with the Drupal 8 Module simple Oauth. and the The format for OAuth 2.0 Bearer tokens is actually described in a separate spec, RFC 6750.

    More concrete here

    The entity-body follows the encoding requirements of the "application/x-www-form-urlencoded" content-type as defined by HTML 4.01 [W3C.REC-html401-19991224].

    So, In my particular case, I will try to send a form-data from angular.

    Thanks: Jean Rostan