Bing Maps Ajax API https url? - bing-maps

What's the https url for bing maps ajax api? I can't seem to find it anywhere, and am currently using http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3, which is super slow (takes 20-60 seconds to load on each page request!)

I know its a little late for this but what the heck, add https and a parameter s=1 to the end of the map.
Should be like this:
https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3&s=1

There are two endpoints one is for HTTPS and the other for HTTP
HTTPS:
https://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&s=1
HTTP:
http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0

Related

Nuxt data fetching from api, local path?

I'm trying to get my feet wet with Nuxt.
I understand that there are different scenarios for data-fetching:
- First call: Server fetches data from api, prerenders html/app, sends whole page
- After that: App on client makes requests to api directly, only fetches json
This is handeld by nuxt automatically.
So I guess I have to expose my API to the client as well, correct?
Would I set the base-path of Axios in Nuxt to something like "http://www.myproj.com/api" ?
If yes, is there any way that nuxt can access the api locally when providing server-rendered content (for example "http://localhost:3333") instead?
Yes there is. When configuring axios in your nuxt.config.js you can set a baseURL and a browserBaseURL. Nuxt will use the baseURL when pre-rendering and the browserBaseURL from the client.
You can see this in the docs here.
If you are deploying to a vps you can have your api running on something like http://localhost:3333 and set that as your baseURL. For the browserBaseURL, if you are using https, you would want so set up an upstream for your api in nginx so that your browserBaseURL would be something like '/api'.

getCurrentPosition() and watchPosition() on localhost

I get this error in my Ionic app when I run on my localhost with Chrome (ionic serve):
[Deprecation] getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS.
win # :8100/plugins/cordova-plugin-geolocation/www/android/geolocation.js:35
How to make it disappear ?
How to be sure there's no issue with a device ?
Try again using this plugin in your browser.
It allows to you request any site with ajax from any source, no matter http/https discrepancies and the like. Practically adds the Allow-Control-Allow-Origin: * header in the response.
Please keep in mind that this is a band-aid solution. Your server response has to actually have the 'Access-Control-Allow-Origin': '*' header, preferably with a more specific value than *.
Because switching to HTTPS can be painful or impossible depending on your architecture,
I found a workaround solution: you can use the Google Maps Geolocation API. Although it has usage limits, it does the job. You will need an browser API key, so don't forget to limit it's usage to your page hostname.
I use it as a fallback method to the getCurrentPosition() method if it fails. It allows me to make it work until I switch to HTTPS.
Here's the JSFiddles:
HTTP: getCurrentPosition() will fail and fall back to the API
HTTPS: getCurrentPosition() will succeed

how to send POST HTTP request from Google Chrome without any extensions?

Can we send POST HTTP requests in Google Chrome when using Rest Services?
I have tried few extensions but I need directly from Chrome browser
I think, using the URL bar will always result in a GET.
To send POST requests from a browser, set up an HTML <form> with method="POST", use the action attribute for the REST-URL and input tags for other parameters.
You can do the post and get in the same way as the browser does.
You can use the header to put in information in key, value pair.
Here is a tutorial on how you can do it - Send POST data using XMLHttpRequest
But it would be better if you use chrome extension POSTMAN which is very extensive and clean for testing REST services.

Flickr API request over HTTPS, is it possible?

After migration to https we had a problem with the flickr-api. Cannot find whether the Flickr supports rest over https?
We expect to make this kind of request which works fine over http and no way over https.
https://api.flickr.com/services/rest/?format=json&sort=interestingness-desc&method=flickr.photos.search&tags=Italy&tag_mode=all&api_key=<key>
Any help please or advise?
You can simply replace: http://api.flickr.com/services
with: https://secure.flickr.com/services
Taken from Here
**** Update ****
As Michael pointed out, the URL has changes and it's now - https://api.flickr.com/services
After some hours of searching and posting at yws-flickr. We've seen for two workarounds:
proxying flickr request through your server via https (more load and
some security issues may come out)
pereodically update database of
links via cron service (implement this one)

Is there an option in Play Framework (1.2.4) to always do redirects as HTTPS?

I have not been able to find a way to do this. We need to do a 302 redirect from http://www.doortodoororganics.com to https://www.doortodoororganics.com/landing. The way we are doing it now redirects to http://www.doortodoororganics.com/landing, and then Apache does the redirect to https. I realize I could change it in the Controller, but we have several places in the code where we do redirects, and I would much rather set it once so that all redirects go to HTTPS.
Any suggestions?
Write a Base Controller and have a Before Interceptor which can set the
play.mvc.Http.Request.secure
property to true always.
The Play framework checks this property before redirecting. If true it does a https redirection.
Use a front http server that acts as a proxy in front of your play application. This is trivially done using apache httpd : http://www.cyberciti.biz/tips/howto-apache-force-https-secure-connections.html It could also be done in any other http server such as nginx...