logo
down
shadow

jQuery response is empty in browser, though curl works


jQuery response is empty in browser, though curl works

By : win lee china
Date : October 15 2020, 11:12 PM
To fix the issue you can do Unless you specifically allow your browser alternate settings for local files, everything remains bound by the cross-domain security policy. Files not on a domain (like localhost) can not request files from that domain.
I'm not sure how cross-domain policy works with ports; you may be able to put this file in your port-80-accessible localhost folder (if you have one) and get the job done. Otherwise, you're stuck, unless you can change browser settings to make exceptions (and even then I'm not sure this is doable in any standard browsers).
code :


Share : facebook icon twitter icon
Empty JSON POST response with jQuery but works with Curl

Empty JSON POST response with jQuery but works with Curl


By : Aditya Palta
Date : March 29 2020, 07:55 AM
To fix the issue you can do The JSONP request only allows GET method, so i change the routes on my api controller from POST to GET and it's works perfect.
URL works fine from browser or wget, but comes up empty from Python or cURL

URL works fine from browser or wget, but comes up empty from Python or cURL


By : vvk85
Date : March 29 2020, 07:55 AM
it fixes the issue It seems the server expects a Connection: keep-alive header, which e.g. curl (and I expect the other failing clients too) do not add by default.
With curl you can use this command, which will display a non-empty response:
code :
curl -v -H 'Connection: keep-alive' http://www.comicbookdb.com/browse.php
import httplib2
h = httplib2.Http('.cache')
response, content = h.request('http://www.comicbookdb.com/browse.php', headers={'Connection':'keep-alive'})
print(content)
print(response)
Response from specific URL is not valid text, when using CURL (works fine in browser)

Response from specific URL is not valid text, when using CURL (works fine in browser)


By : user3594753
Date : March 29 2020, 07:55 AM
With these it helps I have just checked the headers of the response. The server is sending the response in GZIP compression mode. Most of the modern browsers can de-compress automatically but not cURL.
We have to unzip the response to get actual data. You can use cURL along with gunzip.
code :
$curl https://tiles.arcgis.com/tiles/z2tnIkrLQ2BRzr6P/arcgis/rest/services/SanFrancisco_Bldgs/SceneServer/layers/0?f=json  | gunzip -
php - curl empty response while browser display json output

php - curl empty response while browser display json output


By : Jacob Swanson
Date : March 29 2020, 07:55 AM
I hope this helps .
HTTP request works with cURL but gets CORS response when made in browser with javascript

HTTP request works with cURL but gets CORS response when made in browser with javascript


By : Astrid Kowalczyk
Date : March 29 2020, 07:55 AM
it helps some times CORS is enforced client side by your browser. If you are not making the request with a browser CORS is not enforced.
Related Posts Related Posts :
  • JavaScript/Angularjs - View a template according to a JSON configuration, multiple ng-repeat
  • Javascript promise then inside a class
  • Using a variable increment to create new variables in Javascript
  • iterate through a html table and get row number for each row in javascript
  • How to design store (state of app) so we change data in store directly without actions, reducers?
  • How do I call 2 or more asynchronous methods in Actions on Google intent fulfilment V2
  • Mapping a different icon depending on property value in React
  • Expanding the width of div after the content exceeds the height of the div
  • React.js pending 4 min before gets response from Express.js backand restful api
  • I have to press a button twice to fill react state from firebase realtime database
  • Simple Class Function Boolean Output
  • Google AdSense "Valuable Inventory: No Content", on a homepage?
  • Why value of `X` in iife chage based on the way we access it?
  • Testing events in Solidity contracts using Truffle
  • react-native-multiple-select how to populate with data stored
  • How to Loop through JSON objects with many JSON array nodes jQuery
  • SAPUI5: Routing with parameters - How get correct path of binding context
  • Refreshing picker items after fetching data from firebase
  • What does setup() do in JS working with PI's GPIO pins
  • How to convert a JSON tree to a dynamic HTML table
  • Hightchart map pie : clic and hide specific pie
  • how to change geojson search parameters from html form
  • Converting formula to JavaScript
  • How do I get the length of the current string, from a yield*
  • remove last part of string following '&&&' with JavaScript Regex
  • Using variables through scripts using module.exports not working
  • All circle elements stuck behind each other
  • D3.js tick format: show when month changes
  • localStorage: I can't remove an item using @ngx-pwa/local-storage
  • Missing delimiting slash between hosts and options
  • Sorting Empty values always to top in Datatables
  • Sort json table by time
  • Browser cannot find imported javascript package, generates error 404
  • DOM querySelector Difference between 2 code lines
  • File download in Angular 6 with ASP.NET Web API
  • Disable button when second option from select element is not picked
  • How to correctly call an event handler function in a parent component with a parameter in ReactJS?
  • Sort method to sort json into json containing arrays of unique values
  • Align element on another element
  • Type '() => void' is not assignable to type 'string'
  • How to get ID from Html table?
  • bootstrap function "modal on shown" not getting triggered
  • JavaScript shop script won’t function as intended
  • How to find a Word that is enclosed from Html Tags?
  • Why am I getting syntax error (JavaScript) trying to do a pagination?
  • Javascript Error : Is Null or Not an Object
  • Building object hierarchy from a 'namespace' string
  • Modifying the 'className' property is extremely slow in IE7
  • How do I get the javascript split function to extract null values from a delimited string
  • How can I access the version number of the Google Maps API in Javascript?
  • javascript ken ken puzzle generator
  • using javascript, how can I count a mix of asian characters and english words
  • Objects in JavaScript defined and undefined at the same time (in a FireFox extension)
  • AJAX: Check if a string is JSON?
  • Find out divs height and setting div height
  • Django Javascript form validation
  • How to activate two JavaScript functions in parallel?
  • What are IE8 add-ons useful for web developer?
  • Drop down price filter
  • Move mouse pointer in JavaScript
  • shadow
    Privacy Policy - Terms - Contact Us © bighow.org