<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>cukelib Module: requestSupport</title> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css"> <link type="text/css" rel="stylesheet" href="styles/site.cerulean.css"> </head> <body> <div class="navbar navbar-default navbar-fixed-top navbar-inverse"> <div class="container"> <div class="navbar-header"> <a class="navbar-brand" href="index.html">cukelib</a> <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="navbar-collapse collapse" id="topNavigation"> <ul class="nav navbar-nav"> <li class="dropdown"> <a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a> <ul class="dropdown-menu "> <li><a href="module-childService.html">childService</a></li><li><a href="module-requestSupport.html">requestSupport</a></li><li><a href="module-serviceControl.html">serviceControl</a></li><li><a href="module-shellSupport.html">shellSupport</a></li><li><a href="module-utilities.html">utilities</a></li> </ul> </li> </ul> <div class="col-sm-3 col-md-3"> <form class="navbar-form" role="search"> <div class="input-group"> <input type="text" class="form-control" placeholder="Search" name="q" id="search-input"> <div class="input-group-btn"> <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button> </div> </div> </form> </div> </div> </div> </div> <div class="container" id="toc-content"> <div class="row"> <div class="col-md-8"> <div id="main"> <h1 class="page-title">Module: requestSupport</h1> <section> <header> </header> <article> <div class="container-overview"> <div class="description"><p>requestSupport</p></div> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="request_support.js.html">request_support.js</a>, <a href="request_support.js.html#sunlight-1-line-1">line 1</a> </li> </ul> </dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <dl> <hr> <dt> <h4 class="name" id=".initialize"><span class="type-signature"><static> </span>initialize( [options])</h4> </dt> <dd> <div class="description"> <p>Initializes the "request" defaults. Should be called in a context which<br>contains the CucumberJS methods (<code>Given</code>, <code>Then</code>, <code>Before</code>, etc.)</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> <optional><br> </td> <td class="default"> {} </td> <td class="description last"><p>merged with<br> Merged with <a href="request_support.js.html#sunlight-1-line-67">standard defaults</a><br> to set request defaultOptions</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="request_support.js.html">request_support.js</a>, <a href="request_support.js.html#sunlight-1-line-69">line 69</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>undefined</p> </div> <h5>Example</h5> <pre class="sunlight-highlight-javascript">requestSupport.initialize.call(this, options);</pre> </dd> <hr> <dt> <h4 class="name" id=".requestGET"><span class="type-signature"><static> </span>requestGET(routeStr [, options])</h4> </dt> <dd> <div class="description"> <p>requestGET - Description</p> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>routeStr</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"><p>Description</p></td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> <optional><br> </td> <td class="default"> {} </td> <td class="description last"><p>Description</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="request_support.js.html">request_support.js</a>, <a href="request_support.js.html#sunlight-1-line-93">line 93</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Description</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">type</span> </dd> </dl> </dd> <hr> <dt> <h4 class="name" id=".requestPOST"><span class="type-signature"><static> </span>requestPOST(routeStr, bodyStr [, options])</h4> </dt> <dd> <div class="description"> <p>Executes POST request to given <code>routeStr</code></p> <p><code>bodyStr</code></p> <ul> <li>as a string will be interpreted as JSON and passed to the request.</li> <li>as an object with a <code>raw</code> property it is interpreted as a single tow cucumber table.<br>The table contents are merged, interpreted as JSON and passed to the request.</li> <li>as a plainObject it is passsed directly to the request.</li> <li>as a function it is assumed to be a <code>done</code> callback and an empty body is sent to the request</li> </ul> </div> <h5>Parameters:</h5> <table class="params table table-striped"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Argument</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>routeStr</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>bodyStr</code></td> <td class="type"> <span class="param-type">string</span> | <span class="param-type">object</span> | <span class="param-type">function</span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="attributes"> <optional><br> </td> <td class="default"> {} </td> <td class="description last"><p>Overides to the request defaults.</p></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source method-doc-label method-doc-details-label">Source:</dt> <dd class="tag-source"> <ul class="dummy"> <li> <a href="request_support.js.html">request_support.js</a>, <a href="request_support.js.html#sunlight-1-line-127">line 127</a> </li> </ul> </dd> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>Response promise from <code>request</code> or <code>null</code> for callback style calls.</p> </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise</span> | <span class="param-type">null</span> </dd> </dl> </dd> </dl> </article> </section> </div> </div> <div class="clearfix"></div> <div class="col-md-3"> <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div> </div> </div> </div> <div class="modal fade" id="searchResults"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title">Search results</h4> </div> <div class="modal-body"></div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div> <footer> <span class="jsdoc-message"> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Mon Feb 20th 2017 using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>. </span> </footer> <script src="scripts/docstrap.lib.js"></script> <script src="scripts/toc.js"></script> <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script> <script> $( function () { $( "[id*='$']" ).each( function () { var $this = $( this ); $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) ); } ); $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () { var $this = $( this ); var example = $this.find( "code" ); exampleText = example.html(); var lang = /{@lang (.*?)}/.exec( exampleText ); if ( lang && lang[1] ) { exampleText = exampleText.replace( lang[0], "" ); example.html( exampleText ); lang = lang[1]; } else { var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/); lang = langClassMatch ? langClassMatch[1] : "javascript"; } if ( lang ) { $this .addClass( "sunlight-highlight-" + lang ) .addClass( "linenums" ) .html( example.html() ); } } ); Sunlight.highlightAll( { lineNumbers : true, showMenu : true, enableDoclinks : true } ); $.catchAnchorLinks( { navbarOffset: 10 } ); $( "#toc" ).toc( { anchorName : function ( i, heading, prefix ) { return $( heading ).attr( "id" ) || ( prefix + i ); }, selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4", showAndHide : false, smoothScrolling: true } ); $( "#main span[id^='toc']" ).addClass( "toc-shim" ); $( '.dropdown-toggle' ).dropdown(); $( "table" ).each( function () { var $this = $( this ); $this.addClass('table'); } ); } ); </script> <!--Navigation and Symbol Display--> <!--Google Analytics--> <script type="text/javascript"> $(document).ready(function() { SearcherDisplay.init(); }); </script> </body> </html>