React native unsupported url (IOS) - ios

Please help to solve Error: unsupported URL (IOS).When i adding data to url from reducer it not working but normally when adding url to fetch data without reducer data it error.(Same code works in Android )

There may be some value in your query string with special characters (like spaces). Try encoding the api url using encodeURI() in javascript. Or, if you are passing another url in your api query params then you may have to encode symbols which are reserved for urls (for eg: ?, :, / etc.) use encodeURIComponent() for this case. This resolved the same issue for me.

I solved with remove spaces i dont know where is space but when i get link from reducer and then replace space to empty and all solved

Related

URL Escaping with Unity (Firebase URL)

I am trying to download a image stored in the Firebase Storage, using Unity. I use Unity Firebase SKD (in Beta...). This is my code:
...
// Points to "1/preview.jpg"
Firebase.Storage.StorageReference img_ref = folder1_ref.Child("/preview.jpg");
// Fetch the download URL
img_ref.GetDownloadUrlAsync().ContinueWith(task => {
Debug.Log(task.Result.ToString());
});
The console output is:
https://firebasestorage.googleapis.com/v0/b/insidehome-29c9e.appspot.com/o/1/preview.jpg?alt=media&token=092a8de8-5047-4bce-b179-edd4101847a3
If I try to download the file using www or a browser, with this URL, I obtain an error. The good URL should be (copied by Firebase console):
https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Finsidehome-29c9e.appspot.com%2Fo%2F1%2Fpreview.jpg%3Falt%3Dmedia%26token%3D092a8de8-5047-4bce-b179-edd4101847a3
The difference is only in a single slash ("/") before the word "preview".
Is this strange? How could I fix it? I try Escape the URL but it change all the slash:
https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Finsidehome-29c9e.appspot.com%2Fo%2F1%2F99%2Fobama.jpg%3Falt%3Dmedia%26token%3D8a33f998-e271-4d7e-8848-356a332b7750
And It does't work. I need to change only the parameters (right) slash
Hi Firebase engineer here. This is a bug and I'm sorry you encountered this. There should be no slash after "/o/". The 2 slashes surrounding the letter "o" are valid, but every forward slash after that should be displayed as %2F.
This is not a general escaping issue as you should not re-escape the entire URL. This is a side effect of a related mono issue in unity where the Uri class incorrectly decodes %2F into a slash when it shouldn't.
You can work around this by simply replacing slashes after "/o/" with %2F. However, you should know about a corresponding issue with UnityWebRequest:
https://issuetracker.unity3d.com/issues/unitywebrequest-dot-url-unescapes-escaped-symbol
where Unity's libraries are also being affected by this bug (so it may break even if you fix the string and pass it back to unity). It looks like that issue was fixed in 5.5.1 (and I've verified it in 5.6 beta).
On the firebase side, we will change our code to account for this issue in mono so it returns the correct url. Until we get this fix out, I suggest using the workaround of replacing slashes or simply use Firebase itself to download the file.
You can use Unity's WWW.EscapeURL to escape url.
string escapedUrl = WWW.EscapeURL("http://www.someurl");

How To Avoid The Firewll error due to an Apostrophe (’) in a URL generated

I'm working on QlikView and there is requirement that a URL would be generated using the filters that I have selected in QV and then it would be parse to another application. The url contains the values that I have selected in QV. We are facing an issue due to the and apostrophe (') in the user name.
Below is url generated. You could see, the generated url is not completely treated as a URL due to the apostrophe.
http://abcworld.com/berlin/cgi-bin/berlinisapi.dll?b_action=berlinViewer&ui.action=run.prompt=false&p_Type=E&p_Tra=Paul O'Donnell&p_AdjType=O&p_UD=2014-08-11
How to overcome this issue? Is there any special character that I could replace it with?
Thanks in advance.
You would want to encode the apostrophe as %27. This is called URL Encoding and is useful when you need to insert characters in a URI that can't normally be represented in a URI, or otherwise have special meaning, like a question mark. Spaces are often encoded as %20. So your final URL might be:
http://abcworld.com/berlin/cgi-bin/berlinisapi.dll?b_action=berlinViewer&ui.action=run.prompt=false&p_Type=E&p_Tra=Paul%20O%27Donnell&p_AdjType=O&p_UD=2014-08-11

Can someone tell me how to create a QR code for a url with parameters

I've tried using a few web pages to create QR code to create a QR for a regular url and they fine.
However, if I had parameters to the url, the resulting url does not decode properly.
If you try this
http://chart.apis.google.com/chart?cht=qr&chs=500x500&choe=UTF-8&chld=H&chl=http://localhost?someparam=1&someotherparam=2
instead of the QR code pointing to http://localhost?someparam=1&someotherparam=2
the Barcodescanner decoder apps on Android and iPhone point to
http://localhost/?someparam=1&someotherparam=2
The forward slash / between what would be the server name (domain name) and the start of the parameter string is obviously incorrect.
I'm assuming that it's something to do with url encoding and I'm just looking for a pointer in the right direction from someone who might had already cracked this nut.
Zxing's QR code generator has the same effect. But it seems to rely on Google also.
http://zxing.appspot.com/generator/
Also
http://d-project.googlecode.com/svn/trunk/misc/qrcode/js/sample.html
You need to URL-encode each parameter value, in your example, the chl parameter in particular. Most languages have libraries for this these days or a web search for "url encoder " will give you a form.
The url encoding of http://localhost?someparam=1&someotherparam=2 is http%3A%2F%2Flocalhost%3Fsomeparam%3D1%26someotherparam%3D2.
Also, any parameter values to a URL that is itself a parameter value have to be independently URL encoded as well.
As Sean mentions below, if you enter your URL into the form on the appspot page, it correctly URL encodes the chart url:
http://chart.apis.google.com/chart?cht=qr&chs=350x350&chld=L&choe=UTF-8&chl=http%3A%2F%2Flocalhost%3Fsomeparam%3D1%26someotherparam%3D
I'm not sure about your extra / comment. If you go to the URL you give, the code value is
http://localhost?someparam=1
which is what is expected because the chl parameter value is not escaped and therefore ends at the first &.

How send parameters with decimal point in url?

I’m using Backbone.js and Rails.
In Backbone.js I use HTML5 push state to set filter parameters in a url.
When the page is reloading I want to pass these parameters to Rails.
I encoded a parameter lat:34.34+lng:45.23 using JavaScript’s encodeURIComponent. It encoded:
/users/nearby/lat:34.34+lng:45.23/
as:
/users/nearby/lat%3A34.34%2Blng%3A45.23
but this route is not found.
If I delete the points from url, it works.
How can I send parameters with a decimal point?
The . is not a character that has to be encoded. Is this causing issues server side?
See here for more details:
http://www.blooberry.com/indexdot/html/topics/urlencoding.htm
I solved my problems adding an "extra" slash to the end of the url.
In your encoded url it is missing.
Hope this helps
One manifestation of this problem is in URL pattern matching, where the Query Param is expected (i.e. matched) to be an integer. This does not match a number with a decimal point. So you get a 404 (URL not found).

Properly url encode space character

I use HttpUtility.UrlEncode to encode any value that is used in a route.
I already solved an issue with encoding forward slashes. The new problem I have now is with spaces. A space is encoded as + .
This works on the VS integrated Webserver, but I have an issue with it in IIS7 on Windows Server 2008.
If I have the URL http://localhost/Home/About/asdas+sdasd
I get the error 404.11 - Request contains double escape sequence.
I know I can just replace the space by "%20", but I dont want to care about propper encoding myself. Is there any ready to use UrlEncoder for MVC out there?
' ' encoded to %20 use HttpUtility.UrlPathEncode.
Any URL Encoding is most often designed to work on the path component of the url, the reason because different schemes have different characters in the safe list. Look for your libraries urlencoder and just use it in the path and above portion of the url.
#HttpUtility.UrlPathEncode(path)
UrlPathEncode just encodes the path of the Url, rather than encoding the whole Url.

Resources