This has been asked before, but did not receive a satisfactory answer.
From my Android application, I need to send an HTTP request to a PC attached via USB. Typ
In USB it is always the host (the PC in your case) which initiates the communication. So you'll need to use tricks to appear that the Android device sends a request. The PC might periodically poll Android (say, every 100 ms) if it has a HTTP request pending and collect it accordingly, similar to what jackbot did. I guess that's what Android to USB Port Forwarding did.
It is not actually the communication which is one way, but the ability initiate connections.
To do this with standard android functionality, you will conceptually have to tunnel the device-initiated connections through an existing PC-initiated connection. For example, using off the shelf tools:
You don't actually have to use SSH, it's just that this packages up the pieces ready to use.
As an alternative idea, some Android devices which support USB tethering to provide mobile network service to a PC implicitly end up creating a bi-directional IP network over the usb cable, which you can use for other purposes. But be very careful that you don't accidentally route all the PC's network traffic through the phone.
If the Android phone supports USB tethering:
Now a web server running on the PC can be sent HTTP requests with this setup.
Unfortunately, you cannot send HTTP requests over a local socket, such as /dev/tty... or alike. By default, the android device, if it acquires an IP address, will have done so via DHCP or a static IP you have set. What you would need to do, is know the IP of the desktop computer.
What are you actually trying to accomplish? Having the application send a request to localhost, which would relay to the PC?
This answer may help "find the ip of desktop over usb tethering"
It should be possible to use USB tethering for this purpose. When you start USB tethering for your PC at Android device then PC and Android became in same local network. It allows to access PC (for example test http server) via HTTP.