| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901 | 
							- // Jest Snapshot v1, https://goo.gl/fbAQLP
 
- exports[`generate request for Golang Native generate GET request 1`] = `
 
- "req, err := http.NewRequest(\\"GET\\", \\"https://httpbin.org/path/to?a=b\\")
 
- req.Header.Set(\\"Authorization\\", \\"Basic bW9ja1VzZXI6bW9ja1Bhc3N3b3Jk\\")
 
- req.Header.Set(\\"h1\\", \\"h1v\\")
 
- req.Header.Set(\\"h2\\", \\"h2v\\")
 
- if err != nil {
 
-   log.Fatalf(\\"An Error Occured %v\\", err)
 
- }
 
- client := &http.Client{}
 
- resp, err := client.Do(req)
 
- if err != nil {
 
-   log.Fatalf(\\"An Error Occured %v\\", err)
 
- }
 
- defer resp.Body.Close()
 
- body, err := ioutil.ReadAll(resp.Body)
 
- if err != nil {
 
-   log.Fatalln(err)
 
- }
 
- "
 
- `;
 
- exports[`generate request for Golang Native generate POST request for JSON 1`] = `
 
- "var reqBody = []byte(\`{\\"foo\\": \\"bar\\", \\"baz\\": \\"qux\\"}\`)
 
- req, err := http.NewRequest(\\"POST\\", \\"https://httpbin.org/path/to?a=b\\", bytes.NewBuffer(reqBody))
 
- req.Header.Set(\\"Content-Type\\", \\"application/json\\")
 
- req.Header.Set(\\"Authorization\\", \\"Bearer abcdefghijklmn\\")
 
- req.Header.Set(\\"h1\\", \\"h1v\\")
 
- req.Header.Set(\\"h2\\", \\"h2v\\")
 
- if err != nil {
 
-   log.Fatalf(\\"An Error Occured %v\\", err)
 
- }
 
- client := &http.Client{}
 
- resp, err := client.Do(req)
 
- if err != nil {
 
-   log.Fatalf(\\"An Error Occured %v\\", err)
 
- }
 
- defer resp.Body.Close()
 
- body, err := ioutil.ReadAll(resp.Body)
 
- if err != nil {
 
-   log.Fatalln(err)
 
- }
 
- "
 
- `;
 
- exports[`generate request for Golang Native generate POST request for XML 1`] = `
 
- "req.Header.Set(\\"Content-Type\\", \\"application/xml\\")
 
- req.Header.Set(\\"Authorization\\", \\"Bearer abcdefghijklmn\\")
 
- req.Header.Set(\\"h1\\", \\"h1v\\")
 
- req.Header.Set(\\"h2\\", \\"h2v\\")
 
- if err != nil {
 
-   log.Fatalf(\\"An Error Occured %v\\", err)
 
- }
 
- client := &http.Client{}
 
- resp, err := client.Do(req)
 
- if err != nil {
 
-   log.Fatalf(\\"An Error Occured %v\\", err)
 
- }
 
- defer resp.Body.Close()
 
- body, err := ioutil.ReadAll(resp.Body)
 
- if err != nil {
 
-   log.Fatalln(err)
 
- }
 
- "
 
- `;
 
- exports[`generate request for Golang Native generate PUT request for www-form-urlencoded 1`] = `
 
- "req, err := http.NewRequest(\\"PUT\\", \\"https://httpbin.org/path/to?a=b\\", strings.NewReader(\\"foo=bar&baz=qux\\"))
 
- req.Header.Set(\\"Content-Type\\", \\"application/x-www-form-urlencoded\\")
 
- if err != nil {
 
-   log.Fatalf(\\"An Error Occured %v\\", err)
 
- }
 
- client := &http.Client{}
 
- resp, err := client.Do(req)
 
- if err != nil {
 
-   log.Fatalf(\\"An Error Occured %v\\", err)
 
- }
 
- defer resp.Body.Close()
 
- body, err := ioutil.ReadAll(resp.Body)
 
- if err != nil {
 
-   log.Fatalln(err)
 
- }
 
- "
 
- `;
 
- exports[`generate request for JavaScript Axios generate GET request 1`] = `
 
- "axios.get('https://httpbin.org/path/to?a=b',{ 
 
-  headers : {    \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\",
 
-     \\"Authorization\\": \\"Basic bW9ja1VzZXI6bW9ja1Bhc3N3b3Jk\\"}
 
- }.then(response => {
 
-     console.log(response);
 
- }).catch(error => {
 
-     console.log(error);
 
- })
 
- "
 
- `;
 
- exports[`generate request for JavaScript Axios generate POST request for JSON 1`] = `
 
- "axios.post('https://httpbin.org/path/to?a=b',{ 
 
-  headers : {    \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\",
 
- \\"Content-Type\\": \\"application/json; charset=utf-8\\",
 
-     \\"Authorization\\": \\"Bearer abcdefghijklmn\\"}
 
- }.then(response => {
 
-     console.log(response);
 
- }).catch(error => {
 
-     console.log(error);
 
- })
 
- "
 
- `;
 
- exports[`generate request for JavaScript Axios generate POST request for XML 1`] = `
 
- "axios.post('https://httpbin.org/path/to?a=b',{ 
 
-  headers : {    \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\",
 
- \\"Content-Type\\": \\"application/xml; charset=utf-8\\",
 
-     \\"Authorization\\": \\"Bearer abcdefghijklmn\\"}
 
- }.then(response => {
 
-     console.log(response);
 
- }).catch(error => {
 
-     console.log(error);
 
- })
 
- "
 
- `;
 
- exports[`generate request for JavaScript Axios generate PUT request for www-form-urlencoded 1`] = `
 
- "axios.put('https://httpbin.org/path/to?a=b', foo=bar&baz=qux,{ 
 
-  headers : {\\"Content-Type\\": \\"application/x-www-form-urlencoded; charset=utf-8\\"}
 
- }.then(response => {
 
-     console.log(response);
 
- }).catch(error => {
 
-     console.log(error);
 
- })
 
- "
 
- `;
 
- exports[`generate request for JavaScript Fetch generate GET request 1`] = `
 
- "fetch(\\"https://httpbin.org/path/to?a=b\\", {
 
-   method: \\"GET\\",
 
-   headers: {
 
-     \\"Authorization\\": \\"Basic bW9ja1VzZXI6bW9ja1Bhc3N3b3Jk\\",
 
-     \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\"
 
-   },
 
-   credentials: \\"same-origin\\"
 
- }).then(function(response) {
 
-   response.status
 
-   response.statusText
 
-   response.headers
 
-   response.url
 
-   return response.text()
 
- }).catch(function(error) {
 
-   error.message
 
- })"
 
- `;
 
- exports[`generate request for JavaScript Fetch generate POST request for JSON 1`] = `
 
- "fetch(\\"https://httpbin.org/path/to?a=b\\", {
 
-   method: \\"POST\\",
 
-   body: JSON.stringify({\\"foo\\": \\"bar\\", \\"baz\\": \\"qux\\"}),
 
-   headers: {
 
-     \\"Authorization\\": \\"Bearer abcdefghijklmn\\",
 
-     \\"Content-Type\\": \\"application/json; charset=utf-8\\",
 
-     \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\"
 
-   },
 
-   credentials: \\"same-origin\\"
 
- }).then(function(response) {
 
-   response.status
 
-   response.statusText
 
-   response.headers
 
-   response.url
 
-   return response.text()
 
- }).catch(function(error) {
 
-   error.message
 
- })"
 
- `;
 
- exports[`generate request for JavaScript Fetch generate POST request for XML 1`] = `
 
- "fetch(\\"https://httpbin.org/path/to?a=b\\", {
 
-   method: \\"POST\\",
 
-   body: <?xml version='1.0' encoding='utf-8'?>
 
- <xml>
 
-   <element foo=\\"bar\\"></element>
 
- </xml>,
 
-   headers: {
 
-     \\"Authorization\\": \\"Bearer abcdefghijklmn\\",
 
-     \\"Content-Type\\": \\"application/xml; charset=utf-8\\",
 
-     \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\"
 
-   },
 
-   credentials: \\"same-origin\\"
 
- }).then(function(response) {
 
-   response.status
 
-   response.statusText
 
-   response.headers
 
-   response.url
 
-   return response.text()
 
- }).catch(function(error) {
 
-   error.message
 
- })"
 
- `;
 
- exports[`generate request for JavaScript Fetch generate PUT request for www-form-urlencoded 1`] = `
 
- "fetch(\\"https://httpbin.org/path/to?a=b\\", {
 
-   method: \\"PUT\\",
 
-   body: \\"foo=bar&baz=qux\\",
 
-   headers: {
 
-     \\"Content-Type\\": \\"application/x-www-form-urlencoded; charset=utf-8\\"
 
-   },
 
-   credentials: \\"same-origin\\"
 
- }).then(function(response) {
 
-   response.status
 
-   response.statusText
 
-   response.headers
 
-   response.url
 
-   return response.text()
 
- }).catch(function(error) {
 
-   error.message
 
- })"
 
- `;
 
- exports[`generate request for JavaScript XHR generate GET request 1`] = `
 
- "const xhr = new XMLHttpRequest()
 
- xhr.open('GET', 'https://httpbin.org/path/to?a=b', true, 'mockUser', 'mockPassword')
 
- xhr.setRequestHeader('h1', 'h1v')
 
- xhr.setRequestHeader('h2', 'h2v')
 
- xhr.send()"
 
- `;
 
- exports[`generate request for JavaScript XHR generate POST request for JSON 1`] = `
 
- "const xhr = new XMLHttpRequest()
 
- xhr.open('POST', 'https://httpbin.org/path/to?a=b', true, null, null)
 
- xhr.setRequestHeader('Authorization', 'Bearer abcdefghijklmn')
 
- xhr.setRequestHeader('h1', 'h1v')
 
- xhr.setRequestHeader('h2', 'h2v')
 
- xhr.setRequestHeader('Content-Type', 'application/json; charset=utf-8')
 
- xhr.send(JSON.stringify({\\"foo\\": \\"bar\\", \\"baz\\": \\"qux\\"}))"
 
- `;
 
- exports[`generate request for JavaScript XHR generate POST request for XML 1`] = `
 
- "const xhr = new XMLHttpRequest()
 
- xhr.open('POST', 'https://httpbin.org/path/to?a=b', true, null, null)
 
- xhr.setRequestHeader('Authorization', 'Bearer abcdefghijklmn')
 
- xhr.setRequestHeader('h1', 'h1v')
 
- xhr.setRequestHeader('h2', 'h2v')
 
- xhr.setRequestHeader('Content-Type', 'application/xml; charset=utf-8')
 
- xhr.send(<?xml version='1.0' encoding='utf-8'?>
 
- <xml>
 
-   <element foo=\\"bar\\"></element>
 
- </xml>)"
 
- `;
 
- exports[`generate request for JavaScript XHR generate PUT request for www-form-urlencoded 1`] = `
 
- "const xhr = new XMLHttpRequest()
 
- xhr.open('PUT', 'https://httpbin.org/path/to?a=b', true, null, null)
 
- xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8')
 
- xhr.send(\\"foo=bar&baz=qux\\")"
 
- `;
 
- exports[`generate request for JavaScript jQuery generate GET request 1`] = `
 
- "jQuery.ajax({
 
-   url: \\"https://httpbin.org/path/to?a=b\\",
 
-   method: \\"GET\\",
 
-   headers: {
 
-     \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\",
 
-     \\"Authorization\\": \\"Basic bW9ja1VzZXI6bW9ja1Bhc3N3b3Jk\\"
 
-   }
 
- }).then(response => {
 
-     console.log(response);
 
- }).catch(error => {
 
-     console.log(error);
 
- })
 
- "
 
- `;
 
- exports[`generate request for JavaScript jQuery generate POST request for JSON 1`] = `
 
- "jQuery.ajax({
 
-   url: \\"https://httpbin.org/path/to?a=b\\",
 
-   method: \\"POST\\",
 
-   body: {\\"foo\\": \\"bar\\", \\"baz\\": \\"qux\\"},
 
-   contentType: \\"application/json; charset=utf-8\\",
 
-   headers: {
 
-     \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\",
 
-     \\"Content-Type\\": \\"application/json; charset=utf-8\\",
 
-     \\"Authorization\\": \\"Bearer abcdefghijklmn\\"
 
-   }
 
- }).then(response => {
 
-     console.log(response);
 
- }).catch(error => {
 
-     console.log(error);
 
- })
 
- "
 
- `;
 
- exports[`generate request for JavaScript jQuery generate POST request for XML 1`] = `
 
- "jQuery.ajax({
 
-   url: \\"https://httpbin.org/path/to?a=b\\",
 
-   method: \\"POST\\",
 
-   body: <?xml version='1.0' encoding='utf-8'?>
 
- <xml>
 
-   <element foo=\\"bar\\"></element>
 
- </xml>,
 
-   contentType: \\"application/xml; charset=utf-8\\",
 
-   headers: {
 
-     \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\",
 
-     \\"Content-Type\\": \\"application/xml; charset=utf-8\\",
 
-     \\"Authorization\\": \\"Bearer abcdefghijklmn\\"
 
-   }
 
- }).then(response => {
 
-     console.log(response);
 
- }).catch(error => {
 
-     console.log(error);
 
- })
 
- "
 
- `;
 
- exports[`generate request for JavaScript jQuery generate PUT request for www-form-urlencoded 1`] = `
 
- "jQuery.ajax({
 
-   url: \\"https://httpbin.org/path/to?a=b\\",
 
-   method: \\"PUT\\",
 
-   body: foo=bar&baz=qux,
 
-   contentType: \\"application/x-www-form-urlencoded; charset=utf-8\\",
 
-   headers: {
 
-     \\"Content-Type\\": \\"application/x-www-form-urlencoded; charset=utf-8\\"
 
-   }
 
- }).then(response => {
 
-     console.log(response);
 
- }).catch(error => {
 
-     console.log(error);
 
- })
 
- "
 
- `;
 
- exports[`generate request for NodeJs Native generate GET request 1`] = `
 
- "const http = require('http');
 
- const url = 'https://httpbin.org/path/to?a=b';
 
- const options = {
 
-   method: 'GET',
 
-   headers: {
 
-     \\"Authorization\\": \\"Basic bW9ja1VzZXI6bW9ja1Bhc3N3b3Jk\\",
 
-     \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\"
 
-   }};
 
- const request = http.request(url, options, (response) => {
 
-   console.log(response);
 
- });
 
- request.on('error', (e) => {
 
-   console.error(e);
 
- });
 
- request.end();"
 
- `;
 
- exports[`generate request for NodeJs Native generate POST request for JSON 1`] = `
 
- "const http = require('http');
 
- const url = 'https://httpbin.org/path/to?a=b';
 
- const options = {
 
-   method: 'POST',
 
-   headers: {
 
-     \\"Authorization\\": \\"Bearer abcdefghijklmn\\",
 
-     \\"Content-Type\\": \\"application/json; charset=utf-8\\",
 
-     \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\"
 
-   }};
 
- const request = http.request(url, options, (response) => {
 
-   console.log(response);
 
- });
 
- request.on('error', (e) => {
 
-   console.error(e);
 
- });
 
- request.write(JSON.stringify({\\"foo\\": \\"bar\\", \\"baz\\": \\"qux\\"}));
 
- request.end();"
 
- `;
 
- exports[`generate request for NodeJs Native generate POST request for XML 1`] = `
 
- "const http = require('http');
 
- const url = 'https://httpbin.org/path/to?a=b';
 
- const options = {
 
-   method: 'POST',
 
-   headers: {
 
-     \\"Authorization\\": \\"Bearer abcdefghijklmn\\",
 
-     \\"Content-Type\\": \\"application/xml; charset=utf-8\\",
 
-     \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\"
 
-   }};
 
- const request = http.request(url, options, (response) => {
 
-   console.log(response);
 
- });
 
- request.on('error', (e) => {
 
-   console.error(e);
 
- });
 
- request.write(\`<?xml version='1.0' encoding='utf-8'?>
 
- <xml>
 
-   <element foo=\\"bar\\"></element>
 
- </xml>\`);
 
- request.end();"
 
- `;
 
- exports[`generate request for NodeJs Native generate PUT request for www-form-urlencoded 1`] = `
 
- "const http = require('http');
 
- const url = 'https://httpbin.org/path/to?a=b';
 
- const options = {
 
-   method: 'PUT',
 
-   headers: {
 
-     \\"Content-Type\\": \\"application/x-www-form-urlencoded; charset=utf-8\\"
 
-   }};
 
- const request = http.request(url, options, (response) => {
 
-   console.log(response);
 
- });
 
- request.on('error', (e) => {
 
-   console.error(e);
 
- });
 
- request.write(\`foo=bar&baz=qux\`);
 
- request.end();"
 
- `;
 
- exports[`generate request for NodeJs Request generate GET request 1`] = `
 
- "const request = require('request');
 
- const options = {
 
-   method: 'get',
 
-   url: 'https://httpbin.org/path/to?a=b',
 
-   headers: {
 
-     \\"Authorization\\": \\"Basic bW9ja1VzZXI6bW9ja1Bhc3N3b3Jk\\",
 
-     \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\"
 
-   }
 
- }
 
- request(options, (error, response) => {
 
-   if (error) throw new Error(error);
 
-   console.log(response.body);
 
- });"
 
- `;
 
- exports[`generate request for NodeJs Request generate POST request for JSON 1`] = `
 
- "const request = require('request');
 
- const options = {
 
-   method: 'post',
 
-   url: 'https://httpbin.org/path/to?a=b',
 
-   body: JSON.stringify({\\"foo\\": \\"bar\\", \\"baz\\": \\"qux\\"}),
 
-   headers: {
 
-     \\"Authorization\\": \\"Bearer abcdefghijklmn\\",
 
-     \\"Content-Type\\": \\"application/json; charset=utf-8\\",
 
-     \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\"
 
-   }
 
- }
 
- request(options, (error, response) => {
 
-   if (error) throw new Error(error);
 
-   console.log(response.body);
 
- });"
 
- `;
 
- exports[`generate request for NodeJs Request generate POST request for XML 1`] = `
 
- "const request = require('request');
 
- const options = {
 
-   method: 'post',
 
-   url: 'https://httpbin.org/path/to?a=b',
 
-   body: \`<?xml version='1.0' encoding='utf-8'?>
 
- <xml>
 
-   <element foo=\\"bar\\"></element>
 
- </xml>\`,
 
-   headers: {
 
-     \\"Authorization\\": \\"Bearer abcdefghijklmn\\",
 
-     \\"Content-Type\\": \\"application/xml; charset=utf-8\\",
 
-     \\"h1\\": \\"h1v\\",
 
-     \\"h2\\": \\"h2v\\"
 
-   }
 
- }
 
- request(options, (error, response) => {
 
-   if (error) throw new Error(error);
 
-   console.log(response.body);
 
- });"
 
- `;
 
- exports[`generate request for NodeJs Request generate PUT request for www-form-urlencoded 1`] = `
 
- "const request = require('request');
 
- const options = {
 
-   method: 'put',
 
-   url: 'https://httpbin.org/path/to?a=b',
 
-   form: {\\"foo\\": \\"bar\\", \\"baz\\": \\"qux\\"},
 
-   headers: {
 
-     \\"Content-Type\\": \\"application/x-www-form-urlencoded; charset=utf-8\\"
 
-   }
 
- }
 
- request(options, (error, response) => {
 
-   if (error) throw new Error(error);
 
-   console.log(response.body);
 
- });"
 
- `;
 
- exports[`generate request for PHP cURL generate GET request 1`] = `
 
- <?php
 
- $curl = curl_init();
 
- curl_setopt_array($curl, array(
 
-   CURLOPT_URL => "https://httpbin.org/path/to?a=b",
 
-   CURLOPT_RETURNTRANSFER => true,
 
-   CURLOPT_ENCODING => "",
 
-   CURLOPT_MAXREDIRS => 10,
 
-   CURLOPT_TIMEOUT => 0,
 
-   CURLOPT_FOLLOWLOCATION => true,
 
-   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
 
-   CURLOPT_CUSTOMREQUEST => "GET",
 
-   CURLOPT_HTTPHEADER => array(
 
-     "Authorization: Basic bW9ja1VzZXI6bW9ja1Bhc3N3b3Jk",
 
-     "h1: h1v",
 
-     "h2: h2v"
 
-   )
 
- ));
 
- $response = curl_exec($curl);
 
- curl_close($curl);
 
- echo $response;
 
- `;
 
- exports[`generate request for PHP cURL generate POST request for JSON 1`] = `
 
- <?php
 
- $curl = curl_init();
 
- curl_setopt_array($curl, array(
 
-   CURLOPT_URL => "https://httpbin.org/path/to?a=b",
 
-   CURLOPT_RETURNTRANSFER => true,
 
-   CURLOPT_ENCODING => "",
 
-   CURLOPT_MAXREDIRS => 10,
 
-   CURLOPT_TIMEOUT => 0,
 
-   CURLOPT_FOLLOWLOCATION => true,
 
-   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
 
-   CURLOPT_CUSTOMREQUEST => "POST",
 
-   CURLOPT_POSTFIELDS => "{\\"foo\\": \\"bar\\", \\"baz\\": \\"qux\\"}",
 
-   CURLOPT_HTTPHEADER => array(
 
-     "Authorization: Bearer abcdefghijklmn",
 
-     "Content-Type: application/json; charset=utf-8",
 
-     "h1: h1v",
 
-     "h2: h2v"
 
-   )
 
- ));
 
- $response = curl_exec($curl);
 
- curl_close($curl);
 
- echo $response;
 
- `;
 
- exports[`generate request for PHP cURL generate POST request for XML 1`] = `
 
- <?php
 
- $curl = curl_init();
 
- curl_setopt_array($curl, array(
 
-   CURLOPT_URL => "https://httpbin.org/path/to?a=b",
 
-   CURLOPT_RETURNTRANSFER => true,
 
-   CURLOPT_ENCODING => "",
 
-   CURLOPT_MAXREDIRS => 10,
 
-   CURLOPT_TIMEOUT => 0,
 
-   CURLOPT_FOLLOWLOCATION => true,
 
-   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
 
-   CURLOPT_CUSTOMREQUEST => "POST",
 
-   CURLOPT_POSTFIELDS => array(<?xmlversion='1.0'encoding='utf-8'?><xml>
 
-   <elementfoo="bar">
 
-     </element>
 
- </xml>),
 
- CURLOPT_HTTPHEADER => array(
 
- "Authorization: Bearer abcdefghijklmn",
 
- "Content-Type: application/xml; charset=utf-8",
 
- "h1: h1v",
 
- "h2: h2v"
 
- )
 
- ));
 
- $response = curl_exec($curl);
 
- curl_close($curl);
 
- echo $response;
 
- `;
 
- exports[`generate request for PHP cURL generate PUT request for www-form-urlencoded 1`] = `
 
- <?php
 
- $curl = curl_init();
 
- curl_setopt_array($curl, array(
 
-   CURLOPT_URL => "https://httpbin.org/path/to?a=b",
 
-   CURLOPT_RETURNTRANSFER => true,
 
-   CURLOPT_ENCODING => "",
 
-   CURLOPT_MAXREDIRS => 10,
 
-   CURLOPT_TIMEOUT => 0,
 
-   CURLOPT_FOLLOWLOCATION => true,
 
-   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
 
-   CURLOPT_CUSTOMREQUEST => "PUT",
 
-   CURLOPT_POSTFIELDS => "foo=bar&baz=qux",
 
-   CURLOPT_HTTPHEADER => array(
 
-     "Content-Type: application/x-www-form-urlencoded; charset=utf-8"
 
-   )
 
- ));
 
- $response = curl_exec($curl);
 
- curl_close($curl);
 
- echo $response;
 
- `;
 
- exports[`generate request for Powershell RestMethod generate GET request 1`] = `
 
- "$headers = @{
 
-   'h1' = 'h1v'
 
-   'h2' = 'h2v'
 
-   'Authorization' = 'Basic bW9ja1VzZXI6bW9ja1Bhc3N3b3Jk'
 
- }
 
- Invoke-RestMethod -Method 'Get' -Uri 'https://httpbin.org/path/to?a=b' -Headers $headers"
 
- `;
 
- exports[`generate request for Powershell RestMethod generate POST request for JSON 1`] = `
 
- "$body = @'
 
- {\\"foo\\": \\"bar\\", \\"baz\\": \\"qux\\"}
 
- '@
 
- $headers = @{
 
-   'h1' = 'h1v'
 
-   'h2' = 'h2v'
 
-   'Content-Type' = 'application/json; charset=utf-8'
 
-   'Authorization' = 'Bearer abcdefghijklmn'
 
- }
 
- Invoke-RestMethod -Method 'Post' -Uri 'https://httpbin.org/path/to?a=b' -ContentType 'application/json; charset=utf-8' -Headers $headers -Body $body"
 
- `;
 
- exports[`generate request for Powershell RestMethod generate POST request for XML 1`] = `
 
- "$body = @'
 
- <?xml version='1.0' encoding='utf-8'?>
 
- <xml>
 
-   <element foo=\\"bar\\"></element>
 
- </xml>
 
- '@
 
- $headers = @{
 
-   'h1' = 'h1v'
 
-   'h2' = 'h2v'
 
-   'Content-Type' = 'application/xml; charset=utf-8'
 
-   'Authorization' = 'Bearer abcdefghijklmn'
 
- }
 
- Invoke-RestMethod -Method 'Post' -Uri 'https://httpbin.org/path/to?a=b' -ContentType 'application/xml; charset=utf-8' -Headers $headers -Body $body"
 
- `;
 
- exports[`generate request for Powershell RestMethod generate PUT request for www-form-urlencoded 1`] = `
 
- "$body = @'
 
- foo=bar&baz=qux
 
- '@
 
- $headers = @{
 
-   'Content-Type' = 'application/x-www-form-urlencoded; charset=utf-8'
 
- }
 
- Invoke-RestMethod -Method 'Put' -Uri 'https://httpbin.org/path/to?a=b' -ContentType 'application/x-www-form-urlencoded; charset=utf-8' -Headers $headers -Body $body"
 
- `;
 
- exports[`generate request for Python HTTP Client generate GET request 1`] = `
 
- "import http.client
 
- import mimetypes
 
- conn = http.client.HTTPSConnection(\\"httpbin.org\\")
 
- headers = {
 
-   'Authorization': 'Basic bW9ja1VzZXI6bW9ja1Bhc3N3b3Jk',
 
-   'h1': 'h1v',
 
-   'h2': 'h2v'
 
- }
 
- payload = ''
 
- conn.request(\\"GET\\", \\"/path/to?a=b\\", payload, headers)
 
- res = conn.getresponse()
 
- data = res.read()
 
- print(data.decode(\\"utf-8\\"))"
 
- `;
 
- exports[`generate request for Python HTTP Client generate POST request for JSON 1`] = `
 
- "import http.client
 
- import mimetypes
 
- conn = http.client.HTTPSConnection(\\"httpbin.org\\")
 
- headers = {
 
-   'Authorization': 'Bearer abcdefghijklmn',
 
-   'h1': 'h1v',
 
-   'h2': 'h2v',
 
-   'Content-Type': 'application/json'
 
- }
 
- payload = \\"{\\\\\\"foo\\\\\\": \\\\\\"bar\\\\\\", \\\\\\"baz\\\\\\": \\\\\\"qux\\\\\\"}\\"
 
- conn.request(\\"POST\\", \\"/path/to?a=b\\", payload, headers)
 
- res = conn.getresponse()
 
- data = res.read()
 
- print(data.decode(\\"utf-8\\"))"
 
- `;
 
- exports[`generate request for Python HTTP Client generate POST request for XML 1`] = `
 
- "import http.client
 
- import mimetypes
 
- conn = http.client.HTTPSConnection(\\"httpbin.org\\")
 
- headers = {
 
-   'Authorization': 'Bearer abcdefghijklmn',
 
-   'h1': 'h1v',
 
-   'h2': 'h2v',
 
-   'Content-Type': 'application/xml'
 
- }
 
- paylod = '''<?xml version='1.0' encoding='utf-8'?>
 
- <xml>
 
-   <element foo=\\"bar\\"></element>
 
- </xml>'''
 
- conn.request(\\"POST\\", \\"/path/to?a=b\\", payload, headers)
 
- res = conn.getresponse()
 
- data = res.read()
 
- print(data.decode(\\"utf-8\\"))"
 
- `;
 
- exports[`generate request for Python HTTP Client generate PUT request for www-form-urlencoded 1`] = `
 
- "import http.client
 
- import mimetypes
 
- conn = http.client.HTTPSConnection(\\"httpbin.org\\")
 
- headers = {
 
-   'Content-Type': 'application/x-www-form-urlencoded'
 
- }
 
- payload = [('foo', 'bar'),
 
-       ('baz', 'qux')]
 
- conn.request(\\"PUT\\", \\"/path/to?a=b\\", payload, headers)
 
- res = conn.getresponse()
 
- data = res.read()
 
- print(data.decode(\\"utf-8\\"))"
 
- `;
 
- exports[`generate request for Python Requests generate GET request 1`] = `
 
- "import requests
 
- url = 'https://httpbin.org/path/to?a=b'
 
- headers = {
 
-   'Authorization': 'Basic bW9ja1VzZXI6bW9ja1Bhc3N3b3Jk',
 
-   'h1': 'h1v',
 
-   'h2': 'h2v'
 
- }
 
- response = requests.request(
 
-   'GET',
 
-   'https://httpbin.org/path/to?a=b',
 
-   headers=headers,
 
- )
 
- print(response)"
 
- `;
 
- exports[`generate request for Python Requests generate POST request for JSON 1`] = `
 
- "import requests
 
- url = 'https://httpbin.org/path/to?a=b'
 
- headers = {
 
-   'Authorization': 'Bearer abcdefghijklmn',
 
-   'h1': 'h1v',
 
-   'h2': 'h2v',
 
-   'Content-Type': 'application/json'
 
- }
 
- data = \\"{\\\\\\"foo\\\\\\": \\\\\\"bar\\\\\\", \\\\\\"baz\\\\\\": \\\\\\"qux\\\\\\"}\\"
 
- response = requests.request(
 
-   'POST',
 
-   'https://httpbin.org/path/to?a=b',
 
-   data=data,
 
-   headers=headers,
 
- )
 
- print(response)"
 
- `;
 
- exports[`generate request for Python Requests generate POST request for XML 1`] = `
 
- "import requests
 
- url = 'https://httpbin.org/path/to?a=b'
 
- headers = {
 
-   'Authorization': 'Bearer abcdefghijklmn',
 
-   'h1': 'h1v',
 
-   'h2': 'h2v',
 
-   'Content-Type': 'application/xml'
 
- }
 
- data = '''<?xml version='1.0' encoding='utf-8'?>
 
- <xml>
 
-   <element foo=\\"bar\\"></element>
 
- </xml>'''
 
- response = requests.request(
 
-   'POST',
 
-   'https://httpbin.org/path/to?a=b',
 
-   data=data,
 
-   headers=headers,
 
- )
 
- print(response)"
 
- `;
 
- exports[`generate request for Python Requests generate PUT request for www-form-urlencoded 1`] = `
 
- "import requests
 
- url = 'https://httpbin.org/path/to?a=b'
 
- headers = {
 
-   'Content-Type': 'application/x-www-form-urlencoded'
 
- }
 
- data = [('foo', 'bar'),
 
-       ('baz', 'qux')]
 
- response = requests.request(
 
-   'PUT',
 
-   'https://httpbin.org/path/to?a=b',
 
-   data=data,
 
-   headers=headers,
 
- )
 
- print(response)"
 
- `;
 
- exports[`generate request for cURL generate GET request 1`] = `
 
- "curl -X GET \\\\
 
-   'https://httpbin.org/path/to?a=b' \\\\
 
-   -H 'Authorization: Basic bW9ja1VzZXI6bW9ja1Bhc3N3b3Jk' \\\\
 
-   -H 'h1: h1v' \\\\
 
-   -H 'h2: h2v'"
 
- `;
 
- exports[`generate request for cURL generate POST request for JSON 1`] = `
 
- "curl -X POST \\\\
 
-   'https://httpbin.org/path/to?a=b' \\\\
 
-   -H 'Authorization: Bearer abcdefghijklmn' \\\\
 
-   -H 'h1: h1v' \\\\
 
-   -H 'h2: h2v' \\\\
 
-   -H 'Content-Type: application/json; charset=utf-8' \\\\
 
-   -d '{\\"foo\\": \\"bar\\", \\"baz\\": \\"qux\\"}'"
 
- `;
 
- exports[`generate request for cURL generate POST request for XML 1`] = `
 
- "curl -X POST \\\\
 
-   'https://httpbin.org/path/to?a=b' \\\\
 
-   -H 'Authorization: Bearer abcdefghijklmn' \\\\
 
-   -H 'h1: h1v' \\\\
 
-   -H 'h2: h2v' \\\\
 
-   -H 'Content-Type: application/xml; charset=utf-8' \\\\
 
-   -d '<?xml version='1.0' encoding='utf-8'?>
 
- <xml>
 
-   <element foo=\\"bar\\"></element>
 
- </xml>'"
 
- `;
 
- exports[`generate request for cURL generate PUT request for www-form-urlencoded 1`] = `
 
- "curl -X PUT \\\\
 
-   'https://httpbin.org/path/to?a=b' \\\\
 
-   -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \\\\
 
-   -d 'foo=bar&baz=qux'"
 
- `;
 
- exports[`generate request for wget generate GET request 1`] = `
 
- "wget -O - --method=GET \\\\
 
-   'https://httpbin.org/path/to?a=b' \\\\
 
-   --header='Authorization: Basic bW9ja1VzZXI6bW9ja1Bhc3N3b3Jk' \\\\
 
-   --header='h1: h1v' \\\\
 
-   --header='h2: h2v'"
 
- `;
 
- exports[`generate request for wget generate POST request for JSON 1`] = `
 
- "wget -O - --method=POST \\\\
 
-   'https://httpbin.org/path/to?a=b' \\\\
 
-   --header='Authorization: Bearer abcdefghijklmn' \\\\
 
-   --header='h1: h1v' \\\\
 
-   --header='h2: h2v' \\\\
 
-   --header='Content-Type: application/json; charset=utf-8' \\\\
 
-   --body-data='{\\"foo\\": \\"bar\\", \\"baz\\": \\"qux\\"}'"
 
- `;
 
- exports[`generate request for wget generate POST request for XML 1`] = `
 
- "wget -O - --method=POST \\\\
 
-   'https://httpbin.org/path/to?a=b' \\\\
 
-   --header='Authorization: Bearer abcdefghijklmn' \\\\
 
-   --header='h1: h1v' \\\\
 
-   --header='h2: h2v' \\\\
 
-   --header='Content-Type: application/xml; charset=utf-8' \\\\
 
-   --body-data='<?xml version='1.0' encoding='utf-8'?>
 
- <xml>
 
-   <element foo=\\"bar\\"></element>
 
- </xml>'"
 
- `;
 
- exports[`generate request for wget generate PUT request for www-form-urlencoded 1`] = `
 
- "wget -O - --method=PUT \\\\
 
-   'https://httpbin.org/path/to?a=b' \\\\
 
-   --header='Content-Type: application/x-www-form-urlencoded; charset=utf-8' \\\\
 
-   --body-data='foo=bar&baz=qux'"
 
- `;
 
 
  |