Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

afoysal's avatar

Register through API

How to register through API ? I am getting error "Only json request are allowed with header 'Accept': 'application/json'".

https://i.stack.imgur.com/VsVhD.png

0 likes
4 replies
martinbean's avatar

@afoysal Do what the error message says? Set the Accept header, and send the POST data as a JSON object.

1 like
martinbean's avatar

@afoysal I have no idea since it’s your application and you haven’t shared any code.

You clearly have some middleware or something putting constraints on requests.

thinkverse's avatar

Postman's default Accept header is set to */* which basically means Postman can process all types of requests, and it is recommended that if you need to specify anything different, remove or untick the old one, and add a new Accept header.

And to add a header to a request in Postman, you need to add it under the Headers tab, from there you can add a new Accept header and untick the default one. The default Accept header cannot be altered so you'll need to add a new one and untick the default.

Please or to participate in this conversation.