C#
C#

help

Root Question Message

sydney
sydney8/12/2022
Send http request using postman

hi all, if we have a Form data like this

body: {"permissions":["see","see_contents"],"include_sub_types":[]}

how can we add them in the postman?
alkasel
alkasel8/12/2022
So you have a form such that, when you submit the form itself, a string like
body: {"permissions":["see","see_contents"],"include_sub_types":[]}

is included in the payload of the http request?
alkasel
alkasel8/12/2022
In that's the case, you just need to include the body of the request in POSTMAN
body > raw field. You can select JSON in order to have JSON highlighting
sydney
sydney8/12/2022
yes.. if i select json it'll be like this.. which i dont think is correct based on the highlighting😅
alkasel
alkasel8/12/2022
yep, that's clearly not valid JSON
alkasel
alkasel8/12/2022
You know more or less how does JSON syntax works?
alkasel
alkasel8/12/2022
{"permissions":["see","see_contents"],"include_sub_types":[]}

^ THIS is valid JSON syntax
alkasel
alkasel8/12/2022
Try pasting it in here
alkasel
alkasel8/12/2022
sydney
sydney8/12/2022
hmm i see, so ive to just paste this without encode the url, i wonder why this request is not working when i try to send it through postman, but it works if i access it through the website directly, have you faced this issue before?
sydney
sydney8/12/2022
it return me something like
<TITLE>...Server Client Error</TITLE>
<H1>Error parsing the GET/POST data stream.</H1><br>Please try again. If the problem persists, contact your ... Server administrator.
alkasel
alkasel8/12/2022
I suggest using the browser developer tools in order to see the precise request the website is performing
alkasel
alkasel8/12/2022
And see if it is any different from the request you perform by means of postman
sydney
sydney8/12/2022
do you mean to copy the web request like this, is that right?
sydney
sydney8/12/2022
for example copy as fetch?
alkasel
alkasel8/12/2022
Note sure what you're looking at, but e.g. if I browser at google while I have the developers tool open in the "network" tab I can see this
alkasel
alkasel8/12/2022
alkasel
alkasel8/12/2022
As you can see, on the right I have all the requests my browser Firefox is performing towards google server and, for each request, I can check header, payload, response etc...
sydney
sydney8/12/2022
@129984592823320576 yes i got that info from Network tab as well, but what can we compare?
alkasel
alkasel8/12/2022
you should compare the body of the request performed by the browser with the body of the request you sent by means of POSTMAN. If I understand correctly, that's the problem
alkasel
alkasel8/12/2022
In the screen I posted, on the most right part you have "[[1, null...". That's the body of the request
sydney
sydney8/12/2022
you mean the payload right haha, yeah that's what i send the first time i was asking the question..
sydney
sydney8/12/2022
i sent this at my first statement
sydney
sydney8/12/2022
but i dont think there's much information in this, this is the payload that i paste into POSTMAN request
alkasel
alkasel8/12/2022
Ah yep now I see
alkasel
alkasel8/12/2022
I don't know then, I don't have the complete context neither. Maybe there is a different header... I don't know
alkasel
alkasel8/12/2022
I tried to help because I know POSTMAN, but this may be out of my scope
alkasel
alkasel8/12/2022
Make sure you have set the http verb in POSTMAN correctly (e.g. POST instead of GET)
sydney
sydney8/12/2022
yeah i set that to be the same as the browser request..
sydney
sydney8/12/2022
im not sure what could be the issue i think i'll try to check further first
sydney
sydney8/12/2022
@129984592823320576 thank you so much for your help!
alkasel
alkasel8/12/2022
No problem 🙂
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy