0

I am currently working with Python requests to get data from an API. I'm trying to have a nested request within the request depending on the value received from one of the responses. So basically, I make a request and one of the fields returned is uid. I want again to pop that value into another request and that value makes part of the url. eg. f"https://registry.nbnatlas.org/ws/dataResource/{uid}". The only issue is that some responses have a null value for the uid field and this throws an error when making the nested request.

What I am trying to do is to skip the second request if the uid field is null

1 Answer 1

2

You can just add if uid is not None: before the second request

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.