Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP POST Configuration Issues | Feature: check interval #71

Open
madlifer opened this issue Oct 25, 2024 · 1 comment
Open

HTTP POST Configuration Issues | Feature: check interval #71

madlifer opened this issue Oct 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@madlifer
Copy link

madlifer commented Oct 25, 2024

I need monitor my Azure OCR API status, But I can't complete the configuration.

Here is the curl type reuqst:

curl --location --request POST 'https://ocrapi.my.site/computervision/imageanalysis:analyze?features=read&model-version=latest&language=en&api-version=2024-02-01' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Content-Type: application/json' \
--header 'Ocp-Apim-Subscription-Key: my-key-value' \
--header 'Accept: */*' \
--header 'Host: ocrapi.my.site' \
--header 'Connection: keep-alive' \
--data-raw '{
    "url": "my-img-url"
}'

You can see that it can accept a application/json type as the body request, but it seems that the current configuration does not support this operation.

In addition, I noticed that other Issues asked for adding custom check interval, this is a scenario, because requesting this API is charged, so maybe that would be a good idea.

@lyc8503
Copy link
Owner

lyc8503 commented Oct 25, 2024

Hi, I think it's possible in the current version. The JSON data in the HTTP POST is just serialized into the string, with a Content-Type header indicating it's a JSON.

so this config should work:

{
  id: 'foo_monitor',
  name: 'My API Monitor',
  method: 'POST',
  target: 'https://example.com',
  headers: {
    'Content-Type': 'application/json'
  },
  body: '{"key1": "value1"}'
}

As for the monitoring interval issue you mentioned, I plan to add a separate cron setting for each request in a subsequent release, which should solve your problem.

However I've been busy with my internship lately and there's no guarantee when a new version will be released. (;′⌒`)

@lyc8503 lyc8503 added the enhancement New feature or request label Feb 8, 2025
@lyc8503 lyc8503 changed the title HTTP POST Configuration Issues HTTP POST Configuration Issues | Feature: check interval Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants