Characters decoding in Postman after GET response - api

I am using Postman to send HTTP GET Request over some endpoints I need for my application.
In my case, I expected to get a list of cities from my HTTP request: I can succesfully send my request but the problem is that I get encoded characters in response:
Milan�KMI"IT
Rome�DRM"IT

Naples�(NA"IT
These are Headers I send along with request:
Could you help me figure out how I can do to decode those strange symbols?

Related

Why does get my response error message got truncated

I'm new to the WorldPay integration development.
I'm having difficulty when I am sending an authorization request from one of our applications and I got this response from the api .
Client error: POST https://try.access.worldpay.com/payments/authorizations resulted in a 400 Bad Request response: {"errorName":"bodyDoesNotMatchSchema","message":"The json body provided does not match the expected schema","validationE (truncated...)
My problem is I was unable to see the complete error message because the response has been truncated. Is there a way to prevent that issue?

POSTMAN - unable to fetch all the RESPONSE HEADERS including TOKEN

I am trying to access the token from the Response Header of the POST request. However, when I POST the request in POSTMAN it doesn’t show all the Response headers which I see on the chrome dev tool.
The KEY in the response header I am after is :
location: https://app.rm.dev/auth/callback/?token=
Also, I can see when I POST the request I receive a GET request in the chain in the Console window [image attached]. I tried but was unable to get all the Response Headers, therefore is there a way I can copy the GET request Token value from the Console window shown in the Image?
Found the solution, just needed to toggle off Auto redirect option in Postman Settings.

Oauth request using RestSharp

I am trying to send oauth request to receive a token and no matter what I do I get an error that nonce was already used. So I decided to send that same request using Fiddler and everything worked flawlessly. The only issue I see is with the request body. I have to send grant_type=client_credentials in the body and it must be of application/x-www-form-urlencoded type. not Json nor XML. RestSharp describes adding JsonBody and XMLbody but both of those would set incorrect content type to the request. In my code I am trying to add the body the following way:
req.AddParameter("grant_type", "client_credentials", ParameterType.RequestBody)
Is that the correct way to add request body? I am also open to all suggestions to what else might be causing that error
Thank you
For OAuth, to generate a token the grant_type, code, client_secret etc. should be sent as an query parameters. In RestSharp it is done as
request.AddQueryParameter("grant_type", "client_credentials")
Everything in detail about OAuth is here

When i POST a URL with Headers with Body data it is working fine in J METER -HTTP API request i get the following Error

In POSTMAN when i POST a URL with Headers with Body data it is working fine and getting Response as 200,but when i POST the same in J meter HTTP API request i am receiving the following Error.
Headers size in bytes: 124
Body size in bytes: 54
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 404
Response message: Resource Not Found
If you're sending the same requests you should be getting the same responses. HTTP Status Code 404 means that URL path is not correct so you need to check the path of your URL as most probably there is a difference there. Even non-printable characters which you cannot see in JMeter GUI are encoded into their equivalents so whitespace becomes %20 so pay attention to literally everything.
In any case given you can successfully execute the request in Postman it means that you can record it using JMeter's HTTP(S) Test Script Recorder
Prepare JMeter for recording, the easiest way is using JMeter Templates Feature
once JMeter creates a Test Plan for your - expand and start the HTTP(S) Test Script Recorder
Prepare Postman for recording, configure it to use JMeter as the proxy:
Run your request in Postman
That's it, JMeter should capture the request and save it under the Recording Controller along with the HTTP Header Manager containing corresponding request headers

What is the correct HTTP response for requests without percent encoded URI?

Talking about HTTP API/HTTP Web server, what is the HTTP response code that the server should returns in case the client did not apply a URL encoding to requests params. I tried to look into HTTP RFCs but nothing specific or useful regarding that.
If the request is invalid, you can return a 400 Bad Request status.
400 Bad Request
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
(Source)
If you want to send a more informative or specific response, you can provide additional details in the response body.