IWebmasterApi.AddBlockedUrl(String, BlockedUrl) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Block page/directory
public:
void AddBlockedUrl(System::String ^ siteUrl, Microsoft::Bing::Webmaster::Api::Interfaces::BlockedUrl ^ blockedUrl);
[System.ServiceModel.FaultContract(typeof(Microsoft.Bing.Webmaster.Api.Interfaces.ApiFault))]
[System.ServiceModel.OperationContract]
[System.ServiceModel.Web.WebInvoke(BodyStyle=System.ServiceModel.Web.WebMessageBodyStyle.WrappedRequest, Method="POST")]
public void AddBlockedUrl (string siteUrl, Microsoft.Bing.Webmaster.Api.Interfaces.BlockedUrl blockedUrl);
abstract member AddBlockedUrl : string * Microsoft.Bing.Webmaster.Api.Interfaces.BlockedUrl -> unit
Parameters
- siteUrl
- String
- blockedUrl
- BlockedUrl
- Attributes
Examples
XML request sample
POST /webmaster/api.svc/pox/AddBlockedUrl?apikey=sampleapikeyedecc1ea4ae341cc8b6 HTTP/1.1
Content-Type: application/xml; charset=utf-8
Host: ssl.bing.com
<AddBlockedUrl xmlns="http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api">
<siteUrl>http://example.com</siteUrl>
<blockedUrl xmlns:a="http://schemas.datacontract.org/2004/07/Microsoft.Bing.Webmaster.Api" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Date>0001-01-01T00:00:00</a:Date>
<a:EntityType>Page</a:EntityType>
<a:RequestType>FullRemoval</a:RequestType>
<a:Url>http://example.com/url1</a:Url>
</blockedUrl>
</AddBlockedUrl>
XML response sample
HTTP/1.1 200 OK
Content-Length: 0
JSON request sample
POST /webmaster/api.svc/json/AddBlockedUrl?apikey=sampleapikeyedecc1ea4ae341cc8b6 HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: ssl.bing.com
{
"siteUrl":"http://example.com",
"blockedUrl":
{
"__type":"BlockedUrl:#Microsoft.Bing.Webmaster.Api",
"Date":"/Date(-62135568000000-0800)/",
"EntityType":0,
"RequestType":1,
"Url":"http://example.com/url1"
}
}
JSON response sample
HTTP/1.1 200 OK
Content-Length: 10
Content-Type: application/json; charset=utf-8
{
"d":null
}