Access data using ajax in json format from proxy url in shopify - proxy

I developed an app and defined a proxy url. I want to get the data from that url in json format in my shopify shop.But it is returning me nothing. If I read in html, It shows me data. Please tell where I am going wrong?

Related

Spring Boot Rest Controller showing data on get request

So basically I have a Spring Rest Controller that returns an object. I call the method from my JS file to retrieve data and it works great. I know I can hide certain data and stuff but is there a way that I can hide the data showing in the browser. What I mean by this is that when I call the method from my browser and not the js file it shows a blank html page with the JSON output of the object. I would like to hide it from the browser view.
Browser is actually the one who is sending the request for you. It adds request headers, compression etc on your behalf so their is no way you can hide your payload from browser. That's the way web work, if you want some essential details not to be read when response packets travel either encode-decode or encrypt-decrypt your response and use HTTPS.

Retrieve JSON response when creating video on Brightcove

I followed the example on http://docs.brightcove.com/en/video-cloud/media/references/reference.html#Video. The response gets shown in an iframe. However, I would like to be able to get the JSON response in order to store the data (i.e., Brightcove video ID) in my own database. I tried using AJAX post but Brightcove doesn't seem to accept post requests from a different origin. Is there a way to simply get the response data without displaying it in an iframe or in a separate window?
You can't get the response data in javascript since the API response does not include CORS headers. You'd need to do this in server-side code, which also has the advantage of not exposing your API token to the browser.

Receive JSON format through REST api without using REST Client

IN magento, as I am using REST api to get the product details with url like http://myserver.com/magento/api/rest/products? But this url returns only in XML format. But I need it in the JSON format.
Can anyone suggest me how to get it in JSON format without using REST client??
you need to set request header explicitly to application/json then the response is served in json.

Ruby http redirection to different subdomain with authentication

I am attempting to scrape the source data of a particular URL using ruby. To begin, I am using Net::http.new to create the http object and then using http.post to pass along the appropriate login data. This works as intended and responds with the appropriate session cookies.
After logging in, and adding the session cookie data to the headers, I then try to access the particular page that I want to scrape. The server responds with a 302 request to an aspx URL on a different subdomain, accompanied with a query string ie. sub.domain.com/path/blah.aspx?md5=jdj456bnn. When I try to load that subdomain using the same technique as I used before, I am met with a user not authorized 302. does anyone know the proper way to load that relocation, or what I could be missing here?
It's very possible a session cookie is being set during the redirect, but your code isn't maintaining it.
"net-http-cheat-sheet" might show how to deal with it, or, look into using Mechanize, which will manage them for you using a cookie jar.

JSON - Return html

I need a request to be sent to an external website with the html back. I then need to extract the text within <td></td>. I am completely new to JSON, and am unsure if it's possible to do this using ajax.
Please could someone point me in the right direction and/or give example code.
You can't directly make a request to an external site via JS and read HTML from it. It's forbidden by the same origin policy. Either the external site has to support you by offering something like JSONP or CORS (not supported by all browsers yet), or you'll have to proxy the request via your own server.

Resources