Created
March 26, 2013 16:55
-
-
Save fehguy/5247069 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(function () { | |
window.swaggerUi = new SwaggerUi({ | |
discoveryUrl:"http://localhost:8002/api/api-docs.json", | |
apiKeyName:"apikey", | |
dom_id:"swagger-ui-container", | |
supportHeaderParams: true, | |
supportedSubmitMethods: ['get', 'post', 'put'], | |
onComplete: function(swaggerApi, swaggerUi){ | |
if(console) { | |
console.log("Loaded SwaggerUI") | |
console.log(swaggerApi); | |
console.log(swaggerUi); | |
} | |
$('pre code').each(function(i, e) {hljs.highlightBlock(e)}); | |
}, | |
onFailure: function(data) { | |
if(console) { | |
console.log("Unable to Load SwaggerUI"); | |
console.log(data); | |
} | |
}, | |
docExpansion: "none" | |
}); | |
window.swaggerUi.load(); | |
}); | |
</script> | |
GET /api/pet.json/3 HTTP/1.1 | |
Host: localhost:8002 | |
Connection: keep-alive | |
Accept: application/json | |
Origin: null | |
apikey: neato | |
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.35 (KHTML, like Gecko) Chrome/27.0.1448.0 Safari/537.35 | |
Content-Type: application/json | |
Accept-Encoding: gzip,deflate,sdch | |
Accept-Language: en-US,en;q=0.8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment