There are two ways to validate an HTTP request on the platform. The first is called "status code," where we check if the response status code belongs to the 200 family (for example, 200, 201, 204, etc.), indicating a successful response.
The second way is by using "String Validation," which can also accept a Regular Expression. Regular Expressions are patterns of characters that associate character sequences in text. We can use regular expressions to extract or replace portions of text( such as an email address or image link in an HTML page), modify the text format, or remove invalid characters. This way, you can perform more complex checks on HTTP response data.This allows you to perform more detailed and precise validations, such as the example below.
If your API returns:
{
status: 1,
name: xyz
}
Any non-zero status result is considered valid, so you would define as:
String Validation:
status: [^0]
For more details on how to use Regular Expressions you can check ou the GoLang documentation.
For questions, inquiries, or technical support, please contact us through the chat on the ElvenWorks platform or on our website.
Comments
0 comments
Please sign in to leave a comment.