How can you set the HTTP protocol version in Postman? - web-services

I need to specify HTTP 1.0 in a POST request via Postman. It defaults to HTTP 1.1. Does anyone know how to specify the version of the HTTP protocol, or am I out of luck?

Unfortunately, it's still not supported by Postman as of April 2019. Previous version of Postman used to be a browser extension and it wasn't possible to fine tune the request. Newer versions, however, run as standalone applications which could allow more low-level control of the request.
See the following comment quoted from the issue #6242 which was opened early April 2019 requesting an option to specify HTTP protocol version:
You'll be pleased to know that work is in progress for more low-level control over the request. Stay tuned.
As of June 2022, however, Postman haven't shared any updates on this.
Depending on what you need, you could use curl. It provides a set of options that allows you to control the version of the HTTP protocol:
--http0.9: Tells curl to be fine with HTTP version 0.9 response.
-0, --http1.0: Tells curl to use HTTP version 1.0.
--http1.1: Tells curl to use HTTP version 1.1.
--http2-prior-knowledge: Tells curl to issue its non-TLS HTTP requests using HTTP/2 without HTTP/1.1 Upgrade. It requires prior knowledge that the server supports HTTP/2 straight away.
--http2: Tells curl to use HTTP version 2.

Apparently this is not supported by Postman. There has been a report for this on the project's Github page (issue), but it doesn't look like this is gonna be implemented any time soon.
There are a couple of alternatives that support HTTP protocol version for Rest and Soap testing:
Tosca Testsuite: Tosca includes Webservice testing for Soap and Rest. Setting the HTTP protocol version can be done in the Webservice TestCase creation.
SoapUI: SoapUI also supports setting the HTTP protocol version

Not supported as of this date. You can try to copy the curl code by clicking on the Code link, and run it, specifying the http version by passing --http parameter to curl.
For example, to run curl in Windows 10, replace the single quotes with double quotes:
curl --http2 --location --request GET "https://myrequesturl...." --header "myTestHeader:test" --header "Content-Type: application/json" --data-raw "{"query":"","variables":{}}"

Related

Is there a way to not specify version in wso2 APIM

I am trying to deploy a Backend API on Wso2-APIM 2.6.0. This Backend API has its versioning in endpoint.
/v1/devices
Now if I add version while creating Wso2 API (coz Version field is mandatory), I will end up having two versioning mechanism in my URL.
curl -k -X GET "https://88.8.88.88:8243/device-management-api**/1.0/v1/**devices?limit=20&page=0&sort=id%2Cdesc" -H "accept: application/hal+json" -H "Authorization: Bearer AAA"
Is there a way I can not specify version in wso2? I guess I should be able to make changes to synapse-config to do the same.
Can someone please point me to the right location?
I am sure this is a very common issue everyone come across.
How do developers get around it? What is the norm in the industry?
Option 1 (recommended):
When you configure the endpoint for the API, configure it with the backend version included. Eg. Set the endpoint like this.
https://xxx.xxx.xxx.xx:yyyy/device-service/v1/
Then you can drop the "backend" version when you invoke. Eg.
https://88.8.88.88:8243/device-management-api/1.0/devices
This is recommended because you shouldn't expose the backend version to the user. Instead what you should expose is the APIM's API version.
Option 2:
Tick the Default version in the manage tab.
Then you can drop the version when you invoke. Eg. Both of these will work.
https://88.8.88.88:8243/device-management-api/v1/devices
https://88.8.88.88:8243/device-management-api/1.0/v1/devices

Can we add TLS version 1.2 while using POSTMAN?

I am not getting a response in my rest webservice as postman sends request via SSL . Can we change it to TLS ?
I think this can be done. It is the other way around, You disable protocols which you don't want to communicate with. So disable it in Postman.
please see the screenshot. My API only accepts TLS1.2 so I disabled all older version and I was able to fix this issue.
Click on setting >> Protocols disabled during handshake
as below picture

using socks proxy with postman

We are trying use socks proxy for tunneling the requests through putty. It used to work in browser version of postman, as we it used to pickup chrome's proxy settings.
The standalone version of postman does not support socks proxy, it just accepts a proxy host and port and no parameters for the socks settings. Is there any way to use socks proxy with standlone postman?
Please advice.
The http-proxy-to-socks NodeJS client is suggested in a helpful post in the Github issue tracking Postman app support for SOCKS5 proxy.
If you have Node.js (and NPM) installed, you can install and configure http-proxy-to-socks on your system and then provide the resulting HTTP proxy values in the existing native Postman app HTTP/HTTPS proxy configuration settings.
On macOS, this simple command creates an HTTP proxy forwarding to my SOCKS proxy:
hpts -s 127.0.0.1:7941 -p 7951
In the Postman (v7.1.1 macOS) 'Proxy' section of preferences/settings, enabling the 'Global Proxy Configuration' and entering the '-p' port value from this command (as well as 'localhost') into the 'Proxy Server' inputs was successful for me.
This particular solution requires less alteration of existing settings in Postman than some other posts in that Github issue that suggest alternative workarounds where URLs have to be remapped to a specific localhost port or similar tedious changes.
One other option to use is a tool privoxy.
There is a blog post on how to use it with Postman: https://www.getpagespeed.com/server-setup/beyond-privoxy
In short, set the forwarding for a domain, where 127.0.0.1:8023 is the SOCKS proxy of yours. This can be done by adding the following line to /etc/privoxy/config.
forward-socks5 .domain.tld 127.0.0.1:8023 .
The default port privoxy listens on is 8118.
Finally configure Postman to use 127.0.0.1:8118 as proxy, i.e., using privoxy which forwards the requests to your SOCKS proxy.

How to configure SOAP endpoint on my PC

I'm new at using SoapUI, I'd like to know if my machine supports SOAP and in case yes, what I can use as an endpoint for my newly created SoapUI project.
My machine is a Windows-10, and on top of that I have installed Cygwin (enabling some UNIX features).
Does somebody know how I can retrieve a possible value for an endpoint for my SoapUI project?
Oops, from the comment I have the impression that my question is badly formulated: on my PC I have a server application, of which I don't know if it supports SOAP (I know it supports HTTP because I'm using localhost in a browser to access it).
However when I use localhost or 127.0.0.1 as an endpoint in my SoapUI project, nothing happens (I see no response and the request log stays empty), hence my question.
Per default, mostly no application will act as a SOAP prodiver, as it is much more complicated as REST/http for example.
If your application has the capability of a SOAP provider, it is usually SOAP over HTTP. But you need to know the correct endpoint url address.
Not only 127.0.0.1
Usually there is a servicename in the url (and you can also try to show wsdl with ?wsdl), like http://127.0.0.1/myapplication/myservice?wsdl
when setting up a new soapui project, you also have to provide the wsdl location
(http://127.0.0.1/myapplication/myservice?wsdl)
Regards, rka

Apache Http Server POST 400

that's my first question here. After long research, I decided to ask for help...
So first I'll explain my scenario. I have some SOAP web services here. They're consumed by an .Net website. The .Net framework used is in version 4.0.
So my web services are configured to accept HTTP/1.0 protocol, due to .Net limitations. In spite of that, everything works fine if I access the service directly to Jboss AS(4.2.2 GA).
But, I have to make it work with Apache web server as the receptor of the request. Apache do a inverse proxy redirection to my service, so the site send requests to port 8080 (that Apache is listening) and send it to jboss that is expecting the request at port 18080.
In many tests, I confirmed that almost every service worked almost fine, sometimes they have the same failure. But one in particular don't work anyway, the request stopped at Apache with status 400 and empty value (the - after the 400) like that:
POST /xxxx/xxxx/xxxxx/MyService HTTP/1.1" 400 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; MS Web Service Client Protocol 4.0.30319.296)
The other requests that are processed have this value filled. I guess is the response size.
Please consider my regards. thanks
After great efforts at my company we discovered using an Sniffer(Wireshark) that we had two problems that let us to had the situation described in this problem.
First problem solved: .Net platform is configured to send by default an empty request. The first attempt failed so .Net was forced to automatically send a second request with authentication. So i figured out 2 requests before the Jboss response formed an http 400 error.
Second Problem solved:
After the other side solved thise previous problem configuring .Net properly, we tested again and the results were conclusive that no more requests was hitting Apache Http Server. - So there was a strong signal that we had something blocking this specific service. With the rocks in my hand, infrastructure people started to move their asses and somehow solved the problem. Mine frustration in the end is that they didn't said nothing about the possible correction. So "suddenly" the communication was restored..
So after all we made it! but with a bitter taste of defeat. Thank you all that supported me in this problem. []s