Answers for "create http request"

7

http request

HTTP request method is made up of four components:
Request Method ==> Get, Post, Put, Delete (these are
the common ones)
Request URL ==> the URL of the resource
Request Header ==> Accept-Language, AcceptEncoding, User-Agent, Host
Request Body ==> This is the data to be sent to the
resource
Request Query Parameters : key value pair 
		 	
HTTP response method is made up of three components:
Response Status Code ==> 200, 301, 404, 500
(these are the most common ones)
Response Header Fields ==> Date, Server, LastModified, Content-Type
Response Body ==> This is the data that comes
back to the client from the server.
Posted by: Guest on December-06-2020
1

http get request format

GET /hello.html HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)
Host: www.tutorialspoint.com
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Posted by: Guest on November-19-2020
0

create http request

const xhr = new XMLHttpRequest();

let method = 'GET';
let endpoint = 'what you looking for';

xhr.open(method, endpoint);
xhr.send();

xhr.onload = () => {
	'working what you get'
};
Posted by: Guest on January-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language