You need to sign in to do that
Don't have an account?
oski93
Method does not exist or incorrect signature: void getHeaderKey(String) from the type System.HttpResponse
Hi folks,
This seems like a weird one (must be dead simple, but not seeing it).
I'm simply trying to access an Http response header key value as specified in the docs,
Thanks for any clues/suggestions.
This seems like a weird one (must be dead simple, but not seeing it).
I'm simply trying to access an Http response header key value as specified in the docs,
- public String getHeader(String key)
Thanks for any clues/suggestions.
public class HttpTesting { public HttpTesting() { String aString = 'aHeaderKey'; HttpRequest anHttpRequest = new HttpRequest(); HttpResponse anHttpResponse = new Http().send(anHttpRequest); System.debug('---> anHttpResponse.getHeaderKeys(): ' + anHttpResponse.getHeaderKeys()); System.debug('---> anHttpResponse.getHeaderKey(aString): ' + anHttpResponse.getHeaderKey(aString)); // <--- 'Method does not exist or incorrect signature: void getHeaderKey(String) from the type System.HttpResponse' } }
All Answers
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_restful_http_httpresponse.htm
I already mentioned (and looked at) this documentation link.
I'm simply finding that I'm unable to save/compile the getHeader(String key) method at all, and get the compiler error I mentioned in my post.
Are you able to save the class that I posted in your org without any error?
Thanks.