Repository navigation
Conversation
|
@strzibny Can you resolve the conflicts? |
Contributor
Author
|
@tanysheng Done. |
- raw() reuses the query() helper and keeps the non-2xx status check - Keep both Markdown and Image API docs in README and lib.rs - Keep 1.2.1 changelog entry below the unreleased Image API entry
# Conflicts: # README.md
- Clean up the upload test temp file even when the upload fails - Name the upload temp file per pid to avoid collisions - Align the Google Lens example with the other examples Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
post_multipart() parsed the response body as JSON without checking the HTTP status. SerpApi reports upload errors as non-2xx JSON (400 for an unsupported image, 401 for an invalid API key), so these only surfaced because the body happened to hold an "error" field. A non-JSON error page from a proxy (502, 413...) failed with a cryptic serde parse error such as "expected value at line 1 column 1". - Extract send() from raw() to check the status and read the body - Route post_multipart() through send() so uploads report HTTP errors like GET requests: "/image failed with HTTP <status>: <body>" - Assert the HTTP status in the invalid image test - Add upload_image_rejects_invalid_api_key to cover HTTP 401 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Send only api_key and source to the Image API - Detect the image MIME type from its signature - Reject images over 500 KB before uploading - Check the sample image download status in the example - Handle missing visual_matches in the example Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documentation: https://serpapi.com/image-api
Done on top of #2 which should be merged first.