Parsing Bearer



  • Good Evening all,

    I have this response from the server:
    "headers": {
    "Authorization": "Bearer C15675B3B391ABF7C879D17AF0E7C82D",

    This is the code i use to parse the Bearer":

    HEADER "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"
    HEADER "Pragma: no-cache"
    HEADER "Accept: /"
    HEADER "Authorization: Bearer <TOKEN>"

    #TOKEN PARSE "<SOURCE>" LR "{"js":{"Authorization":"" """ -> VAR "Authorization"

    And this is the result i get:

    Authorization (Single) = Nothing shows up...

    I saw an example in this forum but to react was closed...the option given i tried also but no luck.
    Any help would be very much appreciated...



  • Can u tell me what exactly you are parsing? if u want parse that authorization u need use <HEADERS()> or <HEADERS{}> not SOURCE



  • @evangel
    Hi Brother...Much appreciated yours repley...I will try it with the change:

    #TOKEN PARSE "<SOURCE>" LR "{"js":{"Authorization":"" """ -> VAR "Authorization"
    ----->>>>><HEADERS()> or <HEADERS{}>



  • Example

    auth: abcd

    if u want parse the "abcd" the value of auth, use <HEADERS(auth)>



  • PARSE "<HEADERS(Authorization)>" LR "" "" -> VAR "AUTH" 
    


  • Much Appreciated Guys...Did not try it out due to be bussy with work...As soon i implent this i will let you both know here...



  • Guys...The options did not work...Thanks for your Help...Appreciated...For now i will leave it for what it is...



  • @Hakka If using

    PARSE "<HEADERS(Authorization)>" LR "" "" -> VAR "AUTH"
    

    I'd just try:

    PARSE "<HEADERS(*)>" LR "\"Authorization\": \"" "\"," -> VAR "AUTH"
    

    Or if that does not work, try:

    PARSE "<HEADERS(*)>" LR "\"Bearer " "\"," -> VAR "AUTH" "Bearer " ""
    

Log in to reply