✨ Better error messages, updated sample test API
This commit is contained in:
@@ -224,7 +224,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<label for="body">response</label>
|
<label for="body">response</label>
|
||||||
<textarea name="body" rows="6" readonly>{{response.body || '(waiting to send request)'}}</textarea>
|
<textarea name="body" rows="10" readonly>{{response.body || '(waiting to send request)'}}</textarea>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ const app = new Vue({
|
|||||||
el: '#app',
|
el: '#app',
|
||||||
data: {
|
data: {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: 'https://yesno.wtf',
|
url: 'https://reqres.in',
|
||||||
auth: 'None',
|
auth: 'None',
|
||||||
path: '/api',
|
path: '/api/users',
|
||||||
httpUser: '',
|
httpUser: '',
|
||||||
httpPassword: '',
|
httpPassword: '',
|
||||||
bearerToken: '',
|
bearerToken: '',
|
||||||
@@ -151,8 +151,8 @@ const app = new Vue({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
xhr.onerror = e => {
|
xhr.onerror = e => {
|
||||||
this.response.status = '0'
|
this.response.status = xhr.status
|
||||||
this.response.body = 'Error ;('
|
this.response.body = xhr.statusText
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addRequestParam() {
|
addRequestParam() {
|
||||||
|
|||||||
Reference in New Issue
Block a user