Enter two values in a single key


#1

I am trying to make a request to a server using PostMan, normally I have no problems using it, but sometimes it happens that in my code (JavaScript), I need to make a request which has an object in the body of this request and I do not know how to do it that PostMan accepts these types of values. Let’s say that the my code is something like this:

let objTract = {
MethodName: ‘sendAPI’,
params: {
url:‘url:https://api.clashroyale.com/v1/players/%23QR8PPVRL’,
token: Bearer tokenCode
}
};

const response = await fetch("https://esliceu.codiblau.com/clashRoyale.php", {
    method: 'POST',
    body: JSON.stringify(objTract),
    headers: {
        "Content-Type": "application/x-www-form-urlencoded"
    }
});

How would it be to make a request of this kind with PostMan? Thank you!!


#2

You need to set up your request body:
https://learning.getpostman.com/docs/postman/sending_api_requests/requests/#raw

Make sure you choose raw, and JSON from the drop down.