Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery get request with headers

$.ajax({
         url: "http://localhost/myawsomecode/",
         data: { param1: 'anyvalue', param2: 'othervalue' },
         type: "GET",
         beforeSend: function(xhr){xhr.setRequestHeader('X-Test-Header', 'SetHereYourValueForTheHeader');},
         success: function() { alert('Success!'); }
      });
 
PREVIOUS NEXT
Tagged: #jquery #request #headers
ADD COMMENT
Topic
Name
7+3 =