|
1 | 1 | // -------------------------------------------------------------------------------------------------------------------- |
2 | 2 | // <copyright company="Aspose" file="BarcodeApi.cs"> |
3 | | -// Copyright (c) 2021 Aspose.BarCode for Cloud |
| 3 | +// Copyright (c) 2022 Aspose.BarCode for Cloud |
4 | 4 | // </copyright> |
5 | 5 | // <summary> |
6 | 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy |
@@ -148,7 +148,6 @@ public System.IO.Stream GetBarcodeGenerate(GetBarcodeGenerateRequest request) |
148 | 148 | resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "barWidthReduction", request.BarWidthReduction); |
149 | 149 | resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "format", request.format); |
150 | 150 |
|
151 | | - var headerParams = new Dictionary<string, string>(); |
152 | 151 |
|
153 | 152 | return _apiInvoker.InvokeBinaryApi( |
154 | 153 | resourcePath, |
@@ -217,14 +216,17 @@ public BarcodeResponseList GetBarcodeRecognize(GetBarcodeRecognizeRequest reques |
217 | 216 | resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storage", request.storage); |
218 | 217 | resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.folder); |
219 | 218 |
|
| 219 | + var contentType = "application/json"; |
220 | 220 | var headerParams = new Dictionary<string, string>(); |
221 | 221 |
|
| 222 | + |
222 | 223 | var response = _apiInvoker.InvokeApi( |
223 | | - resourcePath, |
224 | | - "GET", |
225 | | - null, |
226 | | - headerParams, |
227 | | - null); |
| 224 | + resourcePath, |
| 225 | + "GET", |
| 226 | + contentType, |
| 227 | + null, |
| 228 | + headerParams, |
| 229 | + null); |
228 | 230 |
|
229 | 231 | if (response != null) |
230 | 232 | { |
@@ -288,20 +290,23 @@ public BarcodeResponseList PostBarcodeRecognizeFromUrlOrContent(PostBarcodeRecog |
288 | 290 | resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "rectangleRegion", request.RectangleRegion); |
289 | 291 | resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "url", request.url); |
290 | 292 |
|
| 293 | + var contentType = "application/json"; |
291 | 294 | var headerParams = new Dictionary<string, string>(); |
292 | 295 |
|
| 296 | + |
293 | 297 | if (request.image != null) |
294 | 298 | { |
295 | 299 | formParams.Add("image", _apiInvoker.ToFileInfo(request.image, "image")); |
296 | | - headerParams["Content-Type"] = "multipart/form-data"; |
| 300 | + contentType = "multipart/form-data"; |
297 | 301 |
|
298 | 302 | } |
299 | 303 | var response = _apiInvoker.InvokeApi( |
300 | | - resourcePath, |
301 | | - "POST", |
302 | | - null, |
303 | | - headerParams, |
304 | | - formParams); |
| 304 | + resourcePath, |
| 305 | + "POST", |
| 306 | + contentType, |
| 307 | + null, |
| 308 | + headerParams, |
| 309 | + formParams); |
305 | 310 |
|
306 | 311 | if (response != null) |
307 | 312 | { |
@@ -334,7 +339,6 @@ public System.IO.Stream PostGenerateMultiple(PostGenerateMultipleRequest request |
334 | 339 | .Replace("/?", "?"); |
335 | 340 | resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "format", request.format); |
336 | 341 |
|
337 | | - var headerParams = new Dictionary<string, string>(); |
338 | 342 | var postBody = SerializationHelper.Serialize(request.generatorParamsList); // http body (model) parameter |
339 | 343 | return _apiInvoker.InvokeBinaryApi( |
340 | 344 | resourcePath, |
@@ -413,14 +417,17 @@ public ResultImageInfo PutBarcodeGenerateFile(PutBarcodeGenerateFileRequest requ |
413 | 417 | resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.folder); |
414 | 418 | resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "format", request.format); |
415 | 419 |
|
| 420 | + var contentType = "application/json"; |
416 | 421 | var headerParams = new Dictionary<string, string>(); |
417 | 422 |
|
| 423 | + |
418 | 424 | var response = _apiInvoker.InvokeApi( |
419 | | - resourcePath, |
420 | | - "PUT", |
421 | | - null, |
422 | | - headerParams, |
423 | | - null); |
| 425 | + resourcePath, |
| 426 | + "PUT", |
| 427 | + contentType, |
| 428 | + null, |
| 429 | + headerParams, |
| 430 | + null); |
424 | 431 |
|
425 | 432 | if (response != null) |
426 | 433 | { |
@@ -461,14 +468,17 @@ public BarcodeResponseList PutBarcodeRecognizeFromBody(PutBarcodeRecognizeFromBo |
461 | 468 | resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storage", request.storage); |
462 | 469 | resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.folder); |
463 | 470 |
|
| 471 | + var contentType = "application/json"; |
464 | 472 | var headerParams = new Dictionary<string, string>(); |
| 473 | + |
465 | 474 | var postBody = SerializationHelper.Serialize(request.readerParams); // http body (model) parameter |
466 | 475 | var response = _apiInvoker.InvokeApi( |
467 | | - resourcePath, |
468 | | - "PUT", |
469 | | - postBody, |
470 | | - headerParams, |
471 | | - null); |
| 476 | + resourcePath, |
| 477 | + "PUT", |
| 478 | + contentType, |
| 479 | + postBody, |
| 480 | + headerParams, |
| 481 | + null); |
472 | 482 |
|
473 | 483 | if (response != null) |
474 | 484 | { |
@@ -509,14 +519,17 @@ public ResultImageInfo PutGenerateMultiple(PutGenerateMultipleRequest request) |
509 | 519 | resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "folder", request.folder); |
510 | 520 | resourcePath = UrlHelper.AddQueryParameterToUrl(resourcePath, "storage", request.storage); |
511 | 521 |
|
| 522 | + var contentType = "application/json"; |
512 | 523 | var headerParams = new Dictionary<string, string>(); |
| 524 | + |
513 | 525 | var postBody = SerializationHelper.Serialize(request.generatorParamsList); // http body (model) parameter |
514 | 526 | var response = _apiInvoker.InvokeApi( |
515 | | - resourcePath, |
516 | | - "PUT", |
517 | | - postBody, |
518 | | - headerParams, |
519 | | - null); |
| 527 | + resourcePath, |
| 528 | + "PUT", |
| 529 | + contentType, |
| 530 | + postBody, |
| 531 | + headerParams, |
| 532 | + null); |
520 | 533 |
|
521 | 534 | if (response != null) |
522 | 535 | { |
|
0 commit comments