My question:
How do I get 400 Bad Request, 401, 403 and 404 error purposely, what data I have to modify in the request, or in the body so that I can get these error (response code) I can get? ANy one please help me on this?
This will be down to the API.
Look at what the API needs, and then send something non compliant.
That should trigger one of the above.
If a request needs a JSON body, then donβt send a body at all. It really is down to how the API handles errors.