Hello, we are trying to develop a connector for an...
# replication-troubleshooting
d
Hello, we are trying to develop a connector for an API which all the endpoints work with POST requests: We found that it's is compatible with Airbyte CDK. However it would be grate some help or guidance, Anyone who has experience can give us a hint ?? Thanks
btw: this is what we found: "def request_body_json( self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None, ) -> Optional[Mapping]: """ Override when creating POST/PUT/PATCH requests to populate the body of the request with a JSON payload. At the same time only one of the 'request_body_data' and 'request_body_json' functions can be overridden. """ return None"
m
If you are extending the HttpStream, you can just overwrite the method
http_method
as you can see here: https://github.com/airbytehq/airbyte/blob/6039e6fa5fccf5d77039e5d9a0df54aa1c35eb14/airbyte-cdk/python/airbyte_cdk/sources/streams/http/http.py#L88
it should be as simple as declaring:
http_method = "POST"
on your Stream class, you should also overwrite one of other methods mentioned in the comment (not both)
I often find that is also useful to look for another connector that uses the same functionality. I found this Notion conector that uses POST: https://github.com/airbytehq/airbyte/blob/13bab6ecd2b22039494f9dae854ad87a933dd204[…]-integrations/connectors/source-notion/source_notion/streams.py
d
Thank you very much @Marcelo Pio de Castro 👍