You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cognitive-services/bing-visual-search/quickstarts/csharp.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ manager: nitinme
9
9
ms.service: cognitive-services
10
10
ms.subservice: bing-visual-search
11
11
ms.topic: quickstart
12
-
ms.date: 05/21/2020
12
+
ms.date: 05/22/2020
13
13
ms.author: scottwhi
14
14
---
15
15
@@ -37,15 +37,15 @@ This quickstart demonstrates how to upload an image to the Bing Visual Search AP
37
37
usingSystem.Collections.Generic;
38
38
```
39
39
40
-
2. Addvariablesfor your subscription key, endpoint, and path to the image you want to upload. For the `uriBase` value, you can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpointdisplayedintheAzureportalfor your resource:
40
+
2. Addvariablesfor your subscription key, endpoint, and path to the image you want to upload. For the `uriBase` value, you can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpointdisplayedintheAzureportalfor your resource.
@@ -187,7 +187,7 @@ This quickstart demonstrates how to upload an image to the Bing Visual Search AP
187
187
188
188
## Using HttpClient
189
189
190
-
Ifyouuse `HttpClient`, youcanusethe `MultipartFormDataContent` classto build the form data. Use the following sections of code to replace the corresponding methods in the previous example.
190
+
Ifyouuse `HttpClient`, youcanusethe `MultipartFormDataContent` classto build the form data. Use the following sections of code to replace the corresponding methods in the previous example:
Copy file name to clipboardExpand all lines: articles/cognitive-services/bing-visual-search/quickstarts/go.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ manager: nitinme
9
9
ms.service: cognitive-services
10
10
ms.subservice: bing-visual-search
11
11
ms.topic: quickstart
12
-
ms.date: 05/21/2020
12
+
ms.date: 05/22/2020
13
13
ms.author: aahi
14
14
---
15
15
@@ -232,7 +232,7 @@ resp, err := client.Do(req)
232
232
233
233
## Handle the response
234
234
235
-
The `Unmarshall` function extracts information from the JSON text returned by the Visual Search API. The `go-spew` pretty printer displays the results:
235
+
The `Unmarshall` function extracts information from the JSON text returned by the Visual Search API. The `go-spew` pretty printer displays the results.
236
236
237
237
```go
238
238
// Create a new answer.
@@ -255,7 +255,7 @@ The `Unmarshall` function extracts information from the JSON text returned by th
255
255
256
256
## Results
257
257
258
-
The results identify images similar to the image contained in the POST body. The useful fields are `WebSearchUrl` and `Name`:
258
+
The results identify images similar to the image contained in the POST body. The useful fields are `WebSearchUrl` and `Name`.
2.Create variables for your API endpoint, subscription key, and the path to your image. For the `endpoint` value, you can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource:
51
+
2.Create variables for your API endpoint, subscription key, and the path to your image. For the `endpoint` value, you can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
@@ -57,7 +57,7 @@ Use this quickstart to make your first call to the Bing Visual Search API. This
57
57
```
58
58
59
59
60
-
3.When you upload a local image, the form data must include the `Content-Disposition` header. Set its `name` parameter to "image", and set the `filename` parameter to any string. The contents of the form include the binary data of the image. The maximum image size you can upload is 1MB.
60
+
3.When you upload a local image, the form data must include the `Content-Disposition` header. Set its `name` parameter to "image", and set the `filename` parameter to the file name of the image. The contents of the form include the binary data of the image. The maximum image size you can upload is 1MB.
61
61
62
62
```
63
63
--boundary_1234-abcd
@@ -70,7 +70,7 @@ Use this quickstart to make your first call to the Bing Visual Search API. This
70
70
71
71
## Create the JSON parser
72
72
73
-
Create a method to make the JSON response from the API more readable by using `JsonParser`:
73
+
Create a method to make the JSON response from the API more readable by using `JsonParser`.
74
74
75
75
```java
76
76
public static String prettify(String json_text) {
@@ -83,13 +83,13 @@ public static String prettify(String json_text) {
83
83
84
84
## Construct the search request and query
85
85
86
-
1. In the main method of your application, create an HTTP client using `HttpClientBuilder.create().build();`:
86
+
1. In the main method of your application, create an HTTP client using `HttpClientBuilder.create().build();`.
Copy file name to clipboardExpand all lines: articles/cognitive-services/bing-visual-search/quickstarts/nodejs.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ manager: nitinme
9
9
ms.service: cognitive-services
10
10
ms.subservice: bing-visual-search
11
11
ms.topic: quickstart
12
-
ms.date: 05/21/2020
12
+
ms.date: 05/22/2020
13
13
ms.author: scottwhi
14
14
---
15
15
@@ -35,15 +35,15 @@ Use this quickstart to make your first call to the Bing Visual Search API. This
35
35
var fs =require('fs');
36
36
```
37
37
38
-
2. Create variables for your API endpoint, subscription key, and the path to your image. For the `baseUri` value, you can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource:
38
+
2. Create variables for your API endpoint, subscription key, and the path to your image. For the `baseUri` value, you can use the global endpoint in the following code, or use the [custom subdomain](../../../cognitive-services/cognitive-services-custom-subdomains.md) endpoint displayed in the Azure portal for your resource.
39
39
40
40
```javascript
41
41
var baseUri = 'https://api.cognitive.microsoft.com/bing/v7.0/images/visualsearch';
42
42
var subscriptionKey = 'your-api-key';
43
43
var imagePath = "path-to-your-image";
44
44
```
45
45
46
-
3. Create a function named `requestCallback()` to print the response from the API:
46
+
3. Create a function named `requestCallback()` to print the response from the API.
47
47
48
48
```javascript
49
49
function requestCallback(err, res, body) {
@@ -53,7 +53,7 @@ Use this quickstart to make your first call to the Bing Visual Search API. This
53
53
54
54
## Construct and send the search request
55
55
56
-
1. When you upload a local image, the form data must include the `Content-Disposition`header. Set its `name` parameter to "image", and set the `filename` parameter to any string. The contents of the form include the binary data of the image. The maximum image size you can upload is 1MB.
56
+
1. When you upload a local image, the form data must include the `Content-Disposition`header. Set its `name` parameter to "image", and set the `filename` parameter to the file name of your image. The contents of the form include the binary data of the image. The maximum image size you can upload is 1MB.
57
57
58
58
```
59
59
--boundary_1234-abcd
@@ -64,14 +64,14 @@ Use this quickstart to make your first call to the Bing Visual Search API. This
64
64
--boundary_1234-abcd--
65
65
```
66
66
67
-
2. Create a new `FormData` object with `FormData()`, and append your image path to it by using `fs.createReadStream()`:
67
+
2. Create a new `FormData` object with `FormData()`, and append your image path to it by using `fs.createReadStream()`.
Copy file name to clipboardExpand all lines: articles/cognitive-services/bing-visual-search/quickstarts/python.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ manager: nitinme
9
9
ms.service: cognitive-services
10
10
ms.subservice: bing-visual-search
11
11
ms.topic: quickstart
12
-
ms.date: 05/21/2020
12
+
ms.date: 05/22/2020
13
13
ms.author: scottwhi
14
14
---
15
15
@@ -40,7 +40,7 @@ Use this quickstart to make your first call to the Bing Visual Search API. This
40
40
imagePath = 'your-image-path'
41
41
```
42
42
43
-
3. When you upload a local image, the form data must include the `Content-Disposition` header. Set its `name` parameter to "image", andset the `filename` parameter to any string. The contents of the form include the binary data of the image. The maximum image size you can upload is1MB.
43
+
3. When you upload a local image, the form data must include the `Content-Disposition` header. Set its `name` parameter to "image", andset the `filename` parameter to the file name of your image. The contents of the form include the binary data of the image. The maximum image size you can upload is1MB.
44
44
45
45
```
46
46
--boundary_1234-abcd
@@ -51,21 +51,21 @@ Use this quickstart to make your first call to the Bing Visual Search API. This
51
51
--boundary_1234-abcd--
52
52
```
53
53
54
-
4. Create a dictionary object to hold your request's header information. Bind your subscription key to the string `Ocp-Apim-Subscription-Key`:
54
+
4. Create a dictionary object to hold your request's header information. Bind your subscription key to the string `Ocp-Apim-Subscription-Key`.
Create a method called `print_json()` to accept the API response, andprint the JSON:
68
+
Create a method called `print_json()` to accept the API response, andprint the JSON.
69
69
70
70
```python
71
71
def print_json(obj):
@@ -75,7 +75,7 @@ def print_json(obj):
75
75
76
76
## Send the request
77
77
78
-
Use `requests.post()` to send a request to the Bing Visual Search API. Include the string for your endpoint, header, andfile information. Print `response.json()`with`print_json()`:
78
+
Use `requests.post()` to send a request to the Bing Visual Search API. Include the string for your endpoint, header, andfile information. Print `response.json()`with`print_json()`.
0 commit comments