Service Virtualization

 View Only
  • 1.  Error accessing Request URL through browser

    Posted Jul 08, 2020 03:50 PM
    Hello everyone
    I am have a problem.
    I am using the invoke api to access information about a service. Through the invoke api swagger I can receive the information using the method:
    GET / vses / {vseId} / services / {serviceId} / specifics
    This method also gives me a Request URL to access this information. However, when trying to access this URL through the browser I have the following error:

    {
    "error": "Unsupported accept header: text / html, application / xhtml + xml, application / xml; q = 0.9, image / webp, image / apng, * / *; q = 0.8, application / signed-exchange; v = b3; q = 0.9 valid media types are application / json, application / zip "
    }

    What could be happening?

    Thank you all.

    ------------------------------
    Matheus Souza
    Capgemini-BR
    ------------------------------


  • 2.  RE: Error accessing Request URL through browser

    Posted Jul 09, 2020 02:31 AM
    Hi Matheus,

    Make sure you are passing a header "Accept" with one of the  supported values i.e. application/json.

    When we test in tools like postman etc, by default it gets set to "*/*" which gives this error.

    Thanks

    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------



  • 3.  RE: Error accessing Request URL through browser

    Posted Jul 09, 2020 08:54 AM
    Hi Vaibhav, thanks for your reply.
    How can I pass this header?
    The browser request I'm making takes the form:
    http: // <address>: <port> / lisa-virtualize-invoke / api / v2 / vses / <vseId> / services / <serviceId>


  • 4.  RE: Error accessing Request URL through browser
    Best Answer

    Posted Jul 09, 2020 09:11 AM
    Hi Matheus,

    You can use the curl command or api triggers like Postman, soapui to have the values included in your call.

    However, there is an extension available for chrome which lets you modify the header values for predefined endpoint. Name of extension "Modify Header Value (HTTP Headers)"

    PFB the result for reference:

    Without Header:

    with Header:

    Thanks


    ------------------------------
    Regards,
    Vaibhav Jain
    Capgemini
    ------------------------------



  • 5.  RE: Error accessing Request URL through browser

    Posted Jul 09, 2020 09:27 AM
    Thank you!
    This solved my problem.