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

Add post request handling and BeautifulSoup integration #107

Merged
merged 7 commits into from
Jan 7, 2025

Conversation

mohamedmamdouh22
Copy link
Collaborator

@mohamedmamdouh22 mohamedmamdouh22 commented Jan 6, 2025

  • Implemented support for making POST requests with headers and payloads.
  • Integrated BeautifulSoup for response parsing and content handling.

Important

Add post() method in SoupPage for POST requests and integrate BeautifulSoup for response parsing.

  • Behavior:
    • Added post() method in SoupPage in impl.py to handle POST requests with headers and payloads.
    • Integrates BeautifulSoup for parsing POST response content.
  • Versioning:
    • Updated version to 0.59.2 in pyproject.toml and uv.lock for both harambe-core and harambe-sdk.
  • Dependencies:
    • Added beautifulsoup4 as a dependency in sdk/pyproject.toml.

This description was created by Ellipsis for 5fdcc59. It will automatically update as commits are pushed.

Comment on lines 108 to 114
content_type = res.headers.get("Content-Type", "")
if "application/json" in content_type:
return res.json()
self._soup = BeautifulSoup(res.text, "html.parser")

class SoupResponseWithStatus:
status: int = res.status_code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We we should include res.json() in SoupResponseWithStatus as body

@awtkns awtkns merged commit 9b1cdbc into main Jan 7, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants