Fetch using get method

I have been programming javascript for some time.
But I have not been keeping up with latest developments.
So I recently obtained (O’Reilly) JavaScript: The
Definitive Guide, 7th ed. I have been reading
through it and the developer.mozilla site about
fetch and how it works.
I am not seeing a clear picture of use of the get
method. With the get method a get query string
is appended to the url of the server processing
script (in my projects, pages are self processing
with php on the server side.
I have written a constructor function that wraps
around xmlHTTPRequest object. Input arguments
for a get request are assembled in to a get query
string and appended to the url. And for POST method
the input args are assemble into varname/value pairs
as the body of the POST request.

How is a get query assigned to a url with fetch?

Thank you for time and attention

Are you asking how to handle a GET request on your PHP server?

Ah… no. I know how to handle get requests with php on the server.
I am asking how to apply a get string to the url in fetch.

BUT, I did find a reference on Google after I posted to your forum.
So it looks like my question is answered.

const response = await fetch(’/bezkoder.com/data?title=web’);

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.