c# - Register URL Prefix -
i have url:
"data:image/png;base64,....."
if open on chrome, receive image, don´t know how configure prefix "data" using webrequest.
webrequest.registerprefix("data", new customwebrequestcreator());
i have build custom creator based on "iwebrequestcreate" don´t know have implement there.
public class customwebrequestcreator: iwebrequestcreate { public webrequest create(uri uri) { httpwebrequest webrequest = activator.createinstance(typeof(httpwebrequest), bindingflags.createinstance | bindingflags.public | bindingflags.nonpublic | bindingflags.instance, null, new object[] { uri, null }, null) httpwebrequest; webrequest.useragent = "omg worked!"; homecoming webrequest; } }
i "remote name not resolved" when trying create request:
webrequest.registerprefix("data", new customwebrequestcreator()); webrequest request = webrequest.create("data:image/png;base64,....."); request.credentials = credentialcache.defaultcredentials; webresponse response = request.getresponse(); <-- exception
can help me that?
thanks!!
c# webrequest .net-4.5
No comments:
Post a Comment