Generated Hosted Images by URL (Specifically QR Codes)

Viewed 310

Okay that title might sound confusing but it's hard to describe in a title.

Basically, when you display an image online you typically reference it by URL as the image must be hosted somewhere. So for example this image url is:

https://www.gettyimages.ie/gi-resources/images/Homepage/Hero/UK/CMS_Creative_164657191_Kingfisher.jpg

Stock Photo

So what I assume is happening is the link tells the webpage where to find the data and then the hosting server replies with the image.

My question is

If a web page can interpret a link with information such as

www.example.com/__?id=01&user=ExampleName&email=exampleEmail

and use that information (id, user, and email) to then generate an image could it return the data without actually hosting the image? As in it's just receiving a request and replying?


The goal of this is to have a page with an image that is a QR code generated by an external webapp.

1 Answers

Yes.

Implementation details would of course differ depending on the chosen server side language, but in the end you're going to send a response which would contain the generated image data (in your case the QR code) and the appropriate headers in order for the browser (or requester of the resource) to properly interpret the response.

Example of what you're asking for would be placeholder.com where it responds with an image depending on certain parameters you provide in the URL.

You can also check for example the requests being sent on https://www.qr-code-generator.com (and probably also other QR generator sites) and see that the codes there are generated similarly to your idea.

Related