verification - I need to verify the ownership of website using "metatag" in Webmaster Tools - Response 400: Bad Request -
i need verify ownership of website using "metatag" in webmaster tools. using google webmaster tool api in vb.net. following code logic.
dim client new webclient try dim query string client.headers.add("authorization: googlelogin auth=" + _auth) client.headers.add("gdata-version: 2") client.headers.add("content-type", "application/atom+xml") query = "<atom:entry xmlns:atom=""http://www.w3.org/2005/atom"" " + _ "xmlns:wt=""http://schemas.google.com/webmasters/tools/2007""> " + _ "<atom:id>https://www.google.com/webmasters/tools/feeds/sites/http%3a%2f%2ftestwebsite2.demos.classicinformatics.com%2f</atom:id> " + _ "<atom:category scheme='http://schemas.google.com/g/2005#kind' " + _ "term='http://schemas.google.com/webmasters/tools/2007#site-info'/> " + _ "<wt:verification-method type=""metatag"" in-use=""true""/> " + _ "</atom:entry>" dim response = client.uploadstring("https://www.google.com/webmasters/tools/feeds/sites/http%3a%2f%2ftestwebsite2.demos.classicinformatics.com%2f", _ "put", query) catch ex webexception end try
in above code, after uploading api string, getting 400 bad request error, while if successful, response should sites feed each entry updated , "verified" element set "true".
i have been working on google webmaster api , working similar process stucking feature add site using webmaster tool api. following process explained in given url: https://developers.google.com/oauthplayground/
i followed 3 step. step 1 : need go through aouth login request , authorization code in response.
step 2 : getting access token in exchange of authorization code.
step 3 : , step stuck with.
here, when going consume access token next request, showing me unauthorized access (401).
here code generate request add website using webmaster tool api
webclient client = new webclient();
var query = "<atom:entry xmlns:atom='http://www.w3.org/2005/atom'><atom:content src=\"" + address + "\" /></atom:entry>"; client.headers.add("gdata-version", "2"); client.headers.add("content-type", "application/atom+xml"); client.headers.add("authorization", "oauth " + accesstoken); var response = client.uploadstring("https://www.google.com/webmasters/tools/feeds/sites/", "post", query); //loadlist();
Comments
Post a Comment