Generated code works but Send does not


(Robert) #1

My docs are embedded in our server product. I’ve got it running at http://localhost:9080/webui/onlinedocs/apis/app-mgmt. If I generate Curl code such as

curl --request GET \
  --url http://localhost:9080/api/v2/applications \
  --header 'authorization: STRIIM-TOKEN 01e86a98-debf-91b1-a94d-000ec6fd8764'

and paste in a terminal, I get results, but if I click the Send button, I get

Error sending request Get http://localhost:9080/api/v2/applications: dial tcp 127.0.0.1:9080: getsockopt: connection refused

I’d like to get this working, but in the meantime is it possible to suppress the Send buttons?


(Einnes) #2

This sounds like the reverse of the issue I’m having, where the request works but not the code. I think there’s an error in their script and sometimes it isn’t picking up the userid and password information for authorization. Did you check if the connection was refused because it didn’t form the basic auth header properly? That’s what it’s doing for all of my code gen requests, but it does fine with the test request feature. Curious if yours is a similar issue or not.


(Robert) #3

We have a non-OpenAPI endpoint that posts a username and password and returns a token, which goes in the Authorization variable.

I just suppressed the Send buttons.


(Einnes) #4

How do you do that? Is that a CSS thing? I want to modify the test request box to hide something and change the name of something else.


(Robert) #5

To get rid of the Send buttons:

  1. Go to main.hub > Design tab > Theme tab > Custom CSS and enter:

     .ScenarioStepInput-methodUrl .button {
         display: none;
     }
    
  2. In the Publish options, enable custom CSS.


(Einnes) #6

Will this work for hiding how many seconds the request takes? I have multiple requests to hide that piece.


(Robert) #7

That hides the button entirely. You should ask support.


(Taylor Barnett) #8