当使用 KineticJS生成 canvas 的图像时,该函数stage.toDataURL()
为我提供了一个以 开头的 URL,data:image/png;base64
后跟一个非常长的字符串!
问题: URL 是如何工作的?它不包含 Web 服务器地址,它实际上是从任何地方检索图像吗?
我想将此生成的图像保存到我的网络服务器,将这个非常长的字符串发送到我的服务器是否是最佳做法POST
,并让服务器使用curl
这个 url?
网址
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkIAAADICAYAAAAEE46XAAALwElEQVR4Xu3ZUW7dVgwE0GRD3f86uqEWBVLARlUIxBXEeZmTb8uPPEMbE/nnD/8IECBAgAABAqUCP0v3tjYBAgQIECBA4Ici5AgIECBAgACBWgFFqDZ6ixMgQIAAAQKKkBsgQIAAAQIEagUUodroLU6AAAECBAgoQm6AAAECBAgQqBVQhGqjtzgBAgQIECCgCLkBAgQIECBAoFZAEaqN3uIECBAgQICAIuQGCBAgQIAAgVoBRag2eosTIECAAAECipAbIECAAAECBGoFFKHa6C1OgAABAgQIKEJugAABAgQIEKgVUIRqo7c4AQIECBAgoAi5AQIECBAgQKBWQBGqjd7iBAgQIECAgCLkBggQIECAAIFaAUWoNnqLEyBAgAABAoqQGyBAgAABAgRqBRSh2ugtToAAAQIECChCboAAAQIECBCoFVCEaqO3OAECBAgQIKAIuQECBAgQIECgVkARqo3e4gQIECBAgIAi5AYIECBAgACBWgFFqDZ6ixMgQIAAAQKKkBsgQIAAAQIEagUUodroLU6AAAECBAgoQm6AAAECBAgQqBVQhGqjtzgBAgQIECCgCLkBAgQIECBAoFZAEaqN3uIECBAgQICAIuQGCBAgQIAAgVoBRag2eosTIECAAAECipAbIECAAAECBGoFFKHa6C1OgAABAgQIKEJugAABAgQIEKgVUIRqo7c4AQIECBAgoAi5AQIECBAgQKBWQBGqjd7iBAgQIECAgCLkBggQIECAAIFaAUWoNnqLEyBAgAABAoqQGyBAgAABAgRqBRSh2ugtToAAAQIECChCboAAAQIECBCoFVCEaqO3OAECBAgQIKAIuQECBAgQIECgVkARqo3e4gQ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ugAABAgQIEKgVUIRqo7c4AQIECBAgoAi5AQIECBAgQKBWQBGqjd7iBAgQIECAgCLkBggQIECAAIFaAUWoNnqLEyBAgAABAoqQGyBAgAABAgRqBRSh2ugtToAAAQIECChCboAAAQIECBCoFVCEaqO3OAECBAgQIKAIuQECBAgQIECgVkARqo3e4gQIECBAgIAi5AYIECBAgACBWgFFqDZ6ixMgQIAAAQKKkBsgQIAAAQIEagUUodroLU6AAAECBAgoQm6AAAECBAgQqBVQhGqjtzgBAgQIECCgCLkBAgQIECBAoFZAEaqN3uIECBAgQICAIuQGCBAgQIAAgVoBRag2eosTIECAAAECipAbIECAAAECBGoFFKHa6C1OgAABAgQIKEJugAABAgQIEKgVUIRqo7c4AQIECBAgoAi5AQIECBAgQKBWQBGqjd7iBAgQIECAgCLkBggQIECAAIFaAUWoNnqLEyBAgAABAoqQGyBAgAABAgRqBRSh2ugtToAAAQIECChCboAAAQIECBCoFVCEaqO3OAECBAgQIKAIuQECBAgQIECgVkARqo3e4gQIECBAgIAi5AYIECBAgACBWgFFqDZ6ixMgQIAAAQKKkBsgQIAAAQIEagUUodroLU6AAAECBAgoQm6AAAECBAgQqBVQhGqjtzgBAgQIECCgCLkBAgQIECBAoFZAEaqN3uIECBAgQICAIuQGCBAgQIAAgVoBRag2eosTIECAAAECipAbIECAAAECBGoFFKHa6C1OgAABAgQIKEJugAABAgQIEKgVUIRqo7c4AQIECBAgoAi5AQIECBAgQKBWQBGqjd7iBAgQIECAgCLkBggQIECAAIFaAUWoNnqLEyBAgAABAoqQGyBAgAABAgRqBRSh2ugtToAAAQIECChCboAAAQIECBCoFVCEaqO3OAECBAgQIKAIuQECBAgQIECgVkARqo3e4gQIECBAgMDfiLaSyZOoJNUAAAAASUVORK5CYII=