i'm new for Django REST Framework,help me to escape semicolon in django rest framework GET Request.
i'm using postman tool for GET request
Input Request.
Response output is
If you check second image input text after semicolon text(hello) is removed ,so i have lost my original input text as i sended get request.help me achieve this.
Requested code
Thanks
Related
I'm trying to write a VBA code that interacts with the Google's Distance Matrix Api, and returns me the distance between two points. The problem is, when I try to use latin letters (like ã), it returns a Invalid Destination error:
<status>INVALID_REQUEST</status>
<error_message>Invalid request. Invalid 'destinations' parameter.</error_message>
</DistanceMatrixResponse>
The Url I'm using is this:
https://maps.googleapis.com/maps/api/distancematrix/xml?units=metric&origins=Fortaleza&destinations=São+Paulo&key=" & myAPIK
Do you guys know any way to get around this?
But when I use UTF-8 code instead of the word itself, it returns me the distance that I wanted:
https://maps.googleapis.com/maps/api/distancematrix/xml?units=metric&origins=Fortaleza&destinations=S%C3%A3o+Paulo&key=" & myAPIK
I also already tried putting the language (pt-BR) in the Url, but it didn't work.
You're going to want to look at how the actual web page works.
Open the web page in Chrome, then view the Request Traffic in DevTools (F12), it will be on the network tab.
You'll have to find the request in the sidebar, filtering by XHR will help.
When you find the request itself, it will show you how it's encoded. It's unlikely that Latin is the transfer-encoding parameter, and UTF-8 is probably being filtered before the request is sent via JavaScript normalization of your input. But unless you examine the API in DevTools you wont know for sure.
Also if you're just using QueryString (aka the part of the API parameter in the url) to interact with the API, there is a urlencode probably happening. You can see using this website how this works, with Sao Paulo. And you probably need to 'sanitize' your input using an urlencode function before post/get the API.
I am trying create a Bixby capsule that can retrieve values from a website. The getUrl() response will be in HTML. Is there a way to parse through the HTML response for values or somehow converting it to JSON?
You can do that through Bixby using regular expressions, but you would need to parse everything through some regex processing in your code when you get a response from getUrl(). There isn't a way to automatically convert an html response to json. Here are some references to parsing html responses with regex.
I need to record how my client side scripts act in a 3rd party web app. So I am trying to use Fiddler to record the traffic on the 3rd party's machine and then run it here.
Sounds great, but my scripts make AJAX calls to an ASPX (123.aspx) page, and the calls use only POST params, not GET.
This means that the (123.aspx) request URLs recorded in Fiddler are identical, and playback doesn't work properly (every AJAX request matches the first recorded match, not the one with the same POST params).
E.g. let's says the requests are recorded like this
123.aspx [POST param: searchquery=xyz]
123.aspx [POST param: searchquery=abc]
then when I playback the SAZ file, I always get the response for 123.aspx [POST param: searchquery=xyz], even if searchquery=abc.
How can I get Fiddler to treat requests differently if the POST params are different?
I saw extraction rules, and was a little unsure about them, the Telerik documentation returns no results for 'extraction'... are they what I need?
Thanks
Please see the introductory blog post for details about Fiddler AutoResponder's Import for Playback mode which helps address some problems you may encounter when trying to playback a previously-captured SAZ file.
Now, the "Import for playback" mode will not address all possible problems; for instance, if you have multiple POSTs to the same URL captured but their ordering is not the same as was captured when you try to replay the scenario, they will play back in the wrong order and things will be broken.
From the Fiddler Book:
Matching Against Request Bodies
In some cases, a site may use the same request URL for many unrelated operations, specifying the operation desired in the request’s body instead of the URL. You may extend your Match Condition to examine a POST or PUT request’s body by specifying the URLWithBody: prefix for your Match Condition. When this prefix is used, the portion of the string up to the first space character is used as the Match Condition for the request’s URL, while the remainder of the string is used as a Match Condition for the string-representation of the request’s body. For performance reasons, you should specify the URL portion of the Match Condition as narrowly as possible to minimize the number of request bodies that the AutoResponder needs to evaluate. If a request has no body, it will not match any URLWithBody rule.
Your Match Condition may specify the EXACT:, NOT:, and REGEX: prefixes for both the URL and the body. For example:
URLWithBody:upload.php TextToFindInBody
URLWithBody:login.php EXACT:Action=Login
URLWithBody:ping.php NOT:POST Data I Do Not Care About
URLWithBody:EXACT:https://example.com/upload.php REGEX:^.+TextToFind.*$
URLWithBody:REGEX:^.+/upload.php.*$ REGEX:^.+TailOfPOST$
Keep in mind that most POSTs from Web Forms encode the body text, so you should ensure that your Match Condition accounts for such encoding. For instance, to match the following POST:
POST http://www.enhanceie.com/sandbox/FileForm.asp HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 54
2=This+is+some+text&fileentry2=&_charset_=windows-1252
Your Match Condition should be:
URLWithBody:/sandbox/FileForm.asp This+is+some+text
In a Grails architecture, we have some requests where it is possible to send put in %0d and %0a in the request paramaters. This is Ascii encoded text for newline and carriage return.
In this request the parameters sent over are also returned. This means we should be sending back %0a %0d but we are not. You can actually see the new line and carriage return in the response.
I am told this is a security risk because we interpret the text. IS this correct?
And is there a grails solution whereby you ensure none of Controllers whether they be returning Json to Ajax request or Model to a GSP decode the encoded text.
Thanks
Look at the security section of the grails docs - especially the XSS Prevention section.
If you're not encoding the request parameters - users of your app could inject own code to attack your application.
I've no details about your app, but you should encode your parameter as html.
You could set this as default within your Config.groovy:
grails.views.default.codec = "html"
If you set this default you have to be aware of double encoding.
This could happen if a tagLib or a plugin also encodes the parameter as html explicitly.
In my application, I use GET method to get a Excel file back. The url actually contains the parameters that server needs to generate the Excel file. However, sometimes, the parameters may become so long (more then 2000 characters).
I am considering using POST method, but it does not seem that POST method can return a document. Am I right?
Nop, how you request, say GET, PUT and POST, doesn't necessarily affect the server you response.
How to make the response depends on the program on server. If you want to send a binary file after a POST request is totally cool.
Just take a look at sites like megaupload, rapidshare, etc. All of them will send you a file after you POST the recaptcha code.