I'm building an Shiny-App with different API connections. It's all running on a server (CentOS Redhat).
I've got a problem with my API. If I'm running this on my terminal (Mac), everything works.
curl --data "InvestAmountInWei=2000000000000000000&Address=Test“ "http://s*******aw.ch:8002/invest"
Same with the Postman-App. I can do a post there and all will be done perfectly. The post request should transfer the ammount and the adress (like an id) to my r-script which is running via plumber.
As sad, if I do this command through terminal or Postman it works. But I need to do this command with the webbrowser.
I used this link to test it:
http://s*********aw.ch:8002/invest?InvestAmountInWei=1000000000000000000&Address=Jennifer
and now I only get this error in my web browser: {"error":["404 - Resource Not Found"]}
If checkt the iptables as well and it should be fine.
# netstat -ntpl | grep 8002
tcp 0 0 16*.**.**.*6:8002 0.0.0.0:* LISTEN 28563/R
any ideas how I can solve this problem?
When you make a request to a URL in your browser, that's a GET request. If you setup your endpoint to support GET and POST requests at the same location, your browser and Postman requests should both work just fine.
If you want your browser to send a POST request, you'll either need to submit a form to it or use JavaScript.
Related
Strange thing - I have host API on localhost it works proper (via browser). It's a part of bigger project.
I use Postman for testing endpoints, and when I make request via localhost or 127:
-https://localhost:7257/esp32
-https://127.0.0.1:7257/esp32
Postman gives me Status 200 OK and fine data from API, but if I send request via my IP adress:
-https://192.168.8.xxx:7257/esp32 then I see error like this: Error: connect ECONNREFUSED 192.168.8.xxx:7257
What does it cause? Is it correct or no?
Ok, I need to host my application on the outside.
Is there a command I can run? How do I know it is caching my wordpress site?
Just make a curl request to your site and take a look at the X-FastCGI-Cache header. HIT indicates the response was served from cache.
curl -I http://www.your-domain.com
I am trying to use Postman to make some requests to my API and the problem is that always I get a 404 response even when the browser gives me a 200.
Here is my Postman request:
It's very confusing. How could I fix that? Is there a problem with Postman, my Apache, my PHP?
Working with xampp (PHP 7.1.1) and the desktop version of Postman.
Update #1:
The problem seems to be the Postman as it is sending the request via proxy even with that option disabled.
When I send a request to google.com.cu all works fine (it shouldn't be because my connection is behind a proxy and Postman don't know that config).
After that, I unplugged my network, and Postman was not been able to send more requests (all good for external requests) but not for my localhost.
Does Postman need an internet connection to send localhost requests?
Update #2:
The server browser response is OK (symfony welcome page).
I can see in your request that you don’t supply a port number, just localhost and then the route - Is this intentional?
You could try just localhost:<port>/<your_route>
I've been working with a SIM808 and sending HTTP GET requests using the following AT commands:
"AT+HTTPPARA=\"CID\", 1\r\n"
"AT+HTTPINIT\r\n"
"AT+HTTPPARA=\"URL\",\"http://www.example.com/\"\r\n"
"AT+HTTPACTION=0\r\n"
"AT+HTTPREAD\r\n"
and it works fine . But when I replace the URL with https, I only receive "OK"
My question is if there is a way to use AT commands for HTTPS request methods (using SSL).
The answer is to execute AT+HTTPSSL=1 after setting the URL. Hope this helps someone
I am unable to capture local HTTP traffic when my Java client makes a SOAP request to my local Tomcat instance.
My current configuration is
Tomcat instance - run on localhost:8080
Local Java client - run from Windows cmd line
Fiddler - run on localhost:8888
I used Axis2 wsdl2java to create my client SOAP stub, and used my machines IP address when specifying the WSDL (hosted on Tomcat)
wsdl2java -uri http://192.168.0.5:8080/axis2/services/Version?wsdl -p sample.axisversion -d adb -s
So, the generated code has lines like this throughout:
public VersionStub(org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault {
this(configurationContext,"http://192.168.0.5:8080/axis2/services/Version.VersionHttpSoap12Endpoint/" );
}
My client app uses the generated stub and I set the Java proxy to Fiddler using the following code (which gets called before the SOAP stub is actually used):
System.getProperties().put("proxySet", "true");
System.getProperties().put("proxyHost", "localhost");
System.getProperties().put("proxyPort", "8888");
...but still I don't see any request or response traffic in Fiddler. What's missing?
Instead of localhost, try to use ipv4.fiddler, which makes sure your localhost traffic goes through fiddler. See also: http://www.fiddler2.com/Fiddler/Help/hookup.asp#Q-LocalTraffic