I am new to Charles Proxy and Regular expression. I have been trying to rewrite feed an invalid session id to the mobile app to check the error handling.
We have the response body like this:
{
“session_id": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3”
"expiry_time": 42000,
"refresh_token": "MiOiJodHRwOi8vdGVzdC5sdGEuYWNjb3Vr”
}
I am trying to rewrite the session_id and pass an invalid id using Charles rewrite
I have tried here in stackoverflow and couldn't find an answer. I am sure I am doing something wrong as a newbie. Any insight would be really appreciated
The regular expression
"session_id":\[(.*)\]would not match the string"session_id": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3". Basically that regular expression is looking for something like this"session_id":[any text]".Try using this regex
"session_id": "(.*?)". It should match the format you're expecting in the response.I hope this helps. Let me know if you need further information.